From f9667e6c17fb987fa7372d2c7152919c427ba991 Mon Sep 17 00:00:00 2001 From: IgorKoval Date: Fri, 10 Mar 2023 00:45:47 +0300 Subject: [PATCH] 0.67.0 --- API.md | 31 +- Cargo.lock | 554 +- Changelog_TON.md | 11 + README.md | 15 +- compiler/.clang-format | 41 + compiler/.editorconfig | 23 + compiler/.gitignore | 40 +- compiler/.travis.yml | 247 - compiler/CMakeLists.txt | 28 +- compiler/CODING_STYLE.md | 6 +- compiler/CONTRIBUTING.md | 2 +- compiler/Changelog.md | 1038 +- compiler/README.md | 92 + compiler/ReleaseChecklist.md | 100 +- compiler/SECURITY.md | 52 + compiler/appveyor.yml | 110 - compiler/cmake/EthCompilerSettings.cmake | 160 +- compiler/cmake/EthDependencies.cmake | 14 +- compiler/cmake/EthPolicy.cmake | 18 +- compiler/cmake/EthToolchains.cmake | 7 + compiler/cmake/EthUtils.cmake | 8 + compiler/cmake/fmtlib.cmake | 20 + compiler/cmake/jsoncpp.cmake | 14 +- compiler/cmake/range-v3.cmake | 38 + compiler/cmake/templates/ewasm_polyfill.in | 13 + compiler/cmake/templates/license.h.in | 55 + compiler/cmake/toolchains/cxx17.cmake | 4 - compiler/cmake/toolchains/cxx20.cmake | 4 - compiler/cmake/toolchains/default.cmake | 4 - compiler/cmake/toolchains/emscripten.cmake | 2 - compiler/cmake/toolchains/libfuzzer.cmake | 11 +- compiler/cmake/toolchains/ossfuzz.cmake | 3 + compiler/docs/050-breaking-changes.rst | 53 +- compiler/docs/060-breaking-changes.rst | 37 +- compiler/docs/070-breaking-changes.rst | 133 + compiler/docs/080-breaking-changes.rst | 176 + compiler/docs/_static/css/custom.css | 86 +- compiler/docs/_static/css/dark.css | 635 + compiler/docs/_static/css/toggle.css | 83 + .../docs/_static/img/solid-share-arrow.svg | 1 + compiler/docs/_static/js/toggle.js | 39 + compiler/docs/_templates/footer.html | 7 + compiler/docs/_templates/layout.html | 10 +- compiler/docs/_templates/versions.html | 36 + compiler/docs/abi-spec.rst | 406 +- .../docs/analysing-compilation-output.rst | 192 + compiler/docs/assembly.rst | 258 +- compiler/docs/brand-guide.rst | 86 + compiler/docs/bugs.json | 277 +- compiler/docs/bugs.rst | 24 +- compiler/docs/bugs_by_version.json | 976 +- compiler/docs/cheatsheet.rst | 114 + compiler/docs/common-patterns.rst | 120 +- compiler/docs/conf.py | 58 +- compiler/docs/contracts.rst | 1 + .../docs/contracts/abstract-contracts.rst | 42 +- .../contracts/constant-state-variables.rst | 97 +- .../docs/contracts/creating-contracts.rst | 9 +- compiler/docs/contracts/errors.rst | 86 + compiler/docs/contracts/events.rst | 113 +- .../docs/contracts/function-modifiers.rst | 41 +- compiler/docs/contracts/functions.rst | 251 +- compiler/docs/contracts/inheritance.rst | 178 +- compiler/docs/contracts/interfaces.rst | 24 +- compiler/docs/contracts/libraries.rst | 105 +- compiler/docs/contracts/using-for.rst | 131 +- .../docs/contracts/visibility-and-getters.rst | 125 +- compiler/docs/contributing.rst | 238 +- compiler/docs/control-structures.rst | 429 +- compiler/docs/credits-and-attribution.rst | 21 + compiler/{scripts => docs}/docs.sh | 12 +- compiler/docs/examples/blind-auction.rst | 158 +- compiler/docs/examples/micropayment.rst | 92 +- compiler/docs/examples/modular.rst | 15 +- compiler/docs/examples/safe-remote.rst | 58 +- compiler/docs/examples/voting.rst | 33 +- .../docs/ext/html_extra_template_renderer.py | 45 + compiler/docs/ext/remix_code_links.py | 83 + compiler/docs/grammar.rst | 13 + compiler/docs/grammar.txt | 193 - compiler/docs/grammar/SolidityLexer.g4 | 352 + compiler/docs/grammar/SolidityParser.g4 | 582 + compiler/docs/index.rst | 160 +- compiler/docs/installing-solidity.rst | 304 +- .../docs/internals/layout_in_calldata.rst | 16 + compiler/docs/internals/layout_in_memory.rst | 72 + compiler/docs/internals/layout_in_storage.rst | 407 + compiler/docs/internals/optimizer.rst | 1340 ++ compiler/docs/internals/source_mappings.rst | 70 + compiler/docs/internals/variable_cleanup.rst | 52 + .../docs/introduction-to-smart-contracts.rst | 154 +- compiler/docs/ir-breaking-changes.rst | 311 + compiler/docs/language-influences.rst | 25 + compiler/docs/layout-of-source-files.rst | 276 +- compiler/docs/lll.rst | 21 - compiler/docs/metadata.rst | 172 +- compiler/docs/miscellaneous.rst | 813 - compiler/docs/natspec-format.rst | 128 +- compiler/docs/path-resolution.rst | 667 + compiler/docs/requirements.txt | 12 +- compiler/docs/resources.rst | 123 +- compiler/docs/robots.txt.template | 15 + compiler/docs/security-considerations.rst | 387 +- compiler/docs/smtchecker.rst | 888 + compiler/docs/solidity-in-depth.rst | 22 - compiler/docs/structure-of-a-contract.rst | 75 +- compiler/docs/style-guide.rst | 401 +- compiler/docs/types.rst | 4 +- compiler/docs/types/conversion.rst | 72 +- compiler/docs/types/mapping-types.rst | 82 +- .../docs/types/operator-precedence-table.rst | 57 + compiler/docs/types/operators.rst | 70 +- compiler/docs/types/reference-types.rst | 384 +- compiler/docs/types/value-types.rst | 402 +- compiler/docs/units-and-global-variables.rst | 191 +- compiler/docs/using-the-compiler.rst | 453 +- compiler/docs/yul.rst | 681 +- compiler/lib/stdlib_sol.tvm | 2629 +++ compiler/liblangutil/CMakeLists.txt | 8 +- compiler/liblangutil/CharStream.cpp | 72 +- compiler/liblangutil/CharStream.h | 59 +- compiler/liblangutil/CharStreamProvider.h | 57 + compiler/liblangutil/DebugInfoSelection.cpp | 157 + compiler/liblangutil/DebugInfoSelection.h | 86 + compiler/liblangutil/EVMVersion.cpp | 26 - compiler/liblangutil/EVMVersion.h | 12 +- compiler/liblangutil/ErrorReporter.cpp | 112 +- compiler/liblangutil/ErrorReporter.h | 73 +- compiler/liblangutil/Exceptions.cpp | 44 +- compiler/liblangutil/Exceptions.h | 231 +- compiler/liblangutil/ParserBase.cpp | 56 +- compiler/liblangutil/ParserBase.h | 23 +- compiler/liblangutil/Scanner.cpp | 301 +- compiler/liblangutil/Scanner.h | 74 +- compiler/liblangutil/SemVerHandler.cpp | 46 +- compiler/liblangutil/SemVerHandler.h | 15 +- compiler/liblangutil/SourceLocation.cpp | 38 +- compiler/liblangutil/SourceLocation.h | 95 +- .../liblangutil/SourceReferenceExtractor.cpp | 74 +- .../liblangutil/SourceReferenceExtractor.h | 30 +- .../liblangutil/SourceReferenceFormatter.cpp | 211 +- .../liblangutil/SourceReferenceFormatter.h | 86 +- .../SourceReferenceFormatterHuman.h | 80 - compiler/liblangutil/Token.cpp | 83 +- compiler/liblangutil/Token.h | 79 +- compiler/liblangutil/UndefMacros.h | 1 + compiler/liblangutil/UniqueErrorReporter.h | 104 + compiler/libsmtutil/CHCSmtLib2Interface.cpp | 214 + compiler/libsmtutil/CHCSmtLib2Interface.h | 85 + compiler/libsmtutil/CHCSolverInterface.h | 66 + compiler/libsmtutil/CMakeLists.txt | 51 + compiler/libsmtutil/CVC4Interface.cpp | 337 + compiler/libsmtutil/CVC4Interface.h | 74 + compiler/libsmtutil/Exceptions.h | 51 + compiler/libsmtutil/Helpers.h | 58 + compiler/libsmtutil/SMTLib2Interface.cpp | 324 + compiler/libsmtutil/SMTLib2Interface.h | 97 + compiler/libsmtutil/SMTPortfolio.cpp | 157 + compiler/libsmtutil/SMTPortfolio.h | 73 + compiler/libsmtutil/SolverInterface.h | 544 + .../Sorts.cpp} | 26 +- compiler/libsmtutil/Sorts.h | 211 + compiler/libsmtutil/Z3CHCInterface.cpp | 243 + compiler/libsmtutil/Z3CHCInterface.h | 72 + compiler/libsmtutil/Z3Interface.cpp | 474 + compiler/libsmtutil/Z3Interface.h | 75 + compiler/libsmtutil/Z3Loader.cpp | 70 + .../Z3Loader.h} | 26 +- compiler/libsmtutil/genz3wrapper.py | 99 + compiler/libsolc/CMakeLists.txt | 11 +- compiler/libsolc/libsolc.cpp | 81 +- compiler/libsolc/libsolc.h | 9 + compiler/libsolidity/CMakeLists.txt | 42 +- .../analysis/ConstantEvaluator.cpp | 383 +- .../libsolidity/analysis/ConstantEvaluator.h | 50 +- .../analysis/ContractLevelChecker.cpp | 231 +- .../analysis/ContractLevelChecker.h | 16 +- .../analysis/ControlFlowAnalyzer.cpp | 94 +- .../analysis/ControlFlowAnalyzer.h | 23 +- .../analysis/ControlFlowBuilder.cpp | 101 +- .../libsolidity/analysis/ControlFlowBuilder.h | 22 +- .../libsolidity/analysis/ControlFlowGraph.cpp | 25 +- .../libsolidity/analysis/ControlFlowGraph.h | 63 +- .../analysis/ControlFlowRevertPruner.cpp | 169 + .../analysis/ControlFlowRevertPruner.h | 66 + .../analysis/DeclarationContainer.cpp | 70 +- .../analysis/DeclarationContainer.h | 64 +- .../analysis/DeclarationTypeChecker.cpp | 406 + .../analysis/DeclarationTypeChecker.h | 76 + .../analysis/DocStringAnalyser.cpp | 216 +- .../libsolidity/analysis/DocStringAnalyser.h | 32 +- .../analysis/DocStringTagParser.cpp | 339 + .../libsolidity/analysis/DocStringTagParser.h | 81 + .../analysis/FunctionCallGraph.cpp | 338 + .../libsolidity/analysis/FunctionCallGraph.h | 92 + .../libsolidity/analysis/GlobalContext.cpp | 89 +- compiler/libsolidity/analysis/GlobalContext.h | 9 +- .../analysis/ImmutableValidator.cpp | 282 + .../libsolidity/analysis/ImmutableValidator.h | 83 + .../analysis/NameAndTypeResolver.cpp | 520 +- .../analysis/NameAndTypeResolver.h | 70 +- .../libsolidity/analysis/OverrideChecker.cpp | 251 +- .../libsolidity/analysis/OverrideChecker.h | 20 +- .../libsolidity/analysis/PostTypeChecker.cpp | 159 +- .../libsolidity/analysis/PostTypeChecker.h | 16 +- .../analysis/PostTypeContractLevelChecker.cpp | 72 + .../analysis/PostTypeContractLevelChecker.h | 56 + .../analysis/ReferencesResolver.cpp | 297 +- .../libsolidity/analysis/ReferencesResolver.h | 31 +- compiler/libsolidity/analysis/Scoper.cpp | 63 + compiler/libsolidity/analysis/Scoper.h | 45 + .../libsolidity/analysis/StaticAnalyzer.cpp | 78 +- .../libsolidity/analysis/StaticAnalyzer.h | 6 +- .../libsolidity/analysis/SyntaxChecker.cpp | 223 +- compiler/libsolidity/analysis/SyntaxChecker.h | 16 +- compiler/libsolidity/analysis/TypeChecker.cpp | 3214 ++-- compiler/libsolidity/analysis/TypeChecker.h | 72 +- .../libsolidity/analysis/ViewPureChecker.cpp | 106 +- .../libsolidity/analysis/ViewPureChecker.h | 5 + compiler/libsolidity/ast/AST.cpp | 465 +- compiler/libsolidity/ast/AST.h | 831 +- compiler/libsolidity/ast/ASTAnnotations.cpp | 1 + compiler/libsolidity/ast/ASTAnnotations.h | 144 +- compiler/libsolidity/ast/ASTEnums.h | 6 + compiler/libsolidity/ast/ASTForward.h | 23 + ...TJsonConverter.cpp => ASTJsonExporter.cpp} | 546 +- .../{ASTJsonConverter.h => ASTJsonExporter.h} | 33 +- compiler/libsolidity/ast/ASTJsonImporter.cpp | 285 +- compiler/libsolidity/ast/ASTJsonImporter.h | 16 +- compiler/libsolidity/ast/ASTUtils.cpp | 63 +- compiler/libsolidity/ast/ASTUtils.h | 20 +- compiler/libsolidity/ast/ASTVisitor.h | 81 +- compiler/libsolidity/ast/AST_accept.h | 95 +- compiler/libsolidity/ast/AsmJsonImporter.cpp | 305 - compiler/libsolidity/ast/AsmJsonImporter.h | 74 - compiler/libsolidity/ast/CallGraph.cpp | 46 + compiler/libsolidity/ast/CallGraph.h | 75 + .../libsolidity/ast/ExperimentalFeatures.h | 1 + compiler/libsolidity/ast/TypeProvider.cpp | 50 +- compiler/libsolidity/ast/TypeProvider.h | 21 +- compiler/libsolidity/ast/Types.cpp | 2102 ++- compiler/libsolidity/ast/Types.h | 652 +- compiler/libsolidity/codegen/TVM.cpp | 7 +- compiler/libsolidity/codegen/TVM.h | 4 +- compiler/libsolidity/codegen/TVMABI.cpp | 8 +- compiler/libsolidity/codegen/TVMAnalyzer.cpp | 151 +- compiler/libsolidity/codegen/TVMAnalyzer.hpp | 13 +- compiler/libsolidity/codegen/TVMCommons.cpp | 18 +- compiler/libsolidity/codegen/TVMCommons.hpp | 8 +- compiler/libsolidity/codegen/TVMConstants.hpp | 6 - .../codegen/TVMContractCompiler.cpp | 2 +- .../codegen/TVMExpressionCompiler.cpp | 29 +- .../libsolidity/codegen/TVMFunctionCall.cpp | 42 +- .../codegen/TVMFunctionCompiler.cpp | 76 +- .../codegen/TVMFunctionCompiler.hpp | 6 +- .../codegen/TVMInlineFunctionChecker.cpp | 2 +- compiler/libsolidity/codegen/TVMPusher.cpp | 36 +- compiler/libsolidity/codegen/TVMPusher.hpp | 4 +- compiler/libsolidity/codegen/TVMSimulator.cpp | 2 +- .../libsolidity/codegen/TVMStructCompiler.cpp | 4 +- .../libsolidity/codegen/TVMTypeChecker.cpp | 64 +- compiler/libsolidity/codegen/TvmAst.cpp | 2 +- compiler/libsolidity/codegen/TvmAst.hpp | 2 +- .../libsolidity/codegen/TvmAstVisitor.cpp | 1 - .../libsolidity/interface/CompilerStack.cpp | 875 +- .../libsolidity/interface/CompilerStack.h | 198 +- .../libsolidity/interface/DebugSettings.h | 3 +- compiler/libsolidity/interface/FileReader.cpp | 393 + compiler/libsolidity/interface/FileReader.h | 171 + .../libsolidity/interface/ImportRemapper.cpp | 107 + .../libsolidity/interface/ImportRemapper.h | 71 + compiler/libsolidity/interface/Natspec.cpp | 137 +- compiler/libsolidity/interface/Natspec.h | 12 +- .../libsolidity/interface/OptimiserSettings.h | 53 +- compiler/libsolidity/interface/ReadFile.h | 10 +- .../interface/StandardCompiler.cpp | 446 +- .../libsolidity/interface/StandardCompiler.h | 30 +- .../libsolidity/interface/StorageLayout.cpp | 120 + .../libsolidity/interface/StorageLayout.h | 56 + compiler/libsolidity/interface/Version.cpp | 5 +- compiler/libsolidity/interface/Version.h | 11 +- compiler/libsolidity/lsp/FileRepository.cpp | 183 + compiler/libsolidity/lsp/FileRepository.h | 74 + compiler/libsolidity/lsp/GotoDefinition.cpp | 66 + .../lsp/GotoDefinition.h} | 15 +- compiler/libsolidity/lsp/HandlerBase.cpp | 78 + compiler/libsolidity/lsp/HandlerBase.h | 56 + compiler/libsolidity/lsp/LanguageServer.cpp | 566 + compiler/libsolidity/lsp/LanguageServer.h | 132 + compiler/libsolidity/lsp/RenameSymbol.cpp | 282 + compiler/libsolidity/lsp/RenameSymbol.h | 119 + .../libsolidity/lsp/SemanticTokensBuilder.cpp | 283 + .../libsolidity/lsp/SemanticTokensBuilder.h | 123 + compiler/libsolidity/lsp/Transport.cpp | 224 + compiler/libsolidity/lsp/Transport.h | 176 + compiler/libsolidity/lsp/Utils.cpp | 129 + compiler/libsolidity/lsp/Utils.h | 86 + .../libsolidity/parsing/DocStringParser.cpp | 72 +- .../libsolidity/parsing/DocStringParser.h | 27 +- compiler/libsolidity/parsing/Parser.cpp | 916 +- compiler/libsolidity/parsing/Parser.h | 44 +- compiler/libsolidity/parsing/Token.h | 1 + compiler/libsolutil/Algorithms.h | 22 +- compiler/libsolutil/AnsiColorized.h | 1 + compiler/libsolutil/Assertions.h | 62 +- compiler/libsolutil/CMakeLists.txt | 13 +- compiler/libsolutil/Common.h | 79 +- compiler/libsolutil/CommonData.cpp | 57 +- compiler/libsolutil/CommonData.h | 332 +- compiler/libsolutil/CommonIO.cpp | 68 +- compiler/libsolutil/CommonIO.h | 44 +- compiler/libsolutil/ErrorCodes.h | 39 + compiler/libsolutil/Exceptions.cpp | 1 + compiler/libsolutil/Exceptions.h | 23 +- compiler/libsolutil/FixedHash.h | 68 +- .../FunctionSelector.h} | 32 +- compiler/libsolutil/IndentedWriter.cpp | 1 + compiler/libsolutil/IndentedWriter.h | 1 + compiler/libsolutil/InvertibleMap.h | 93 - compiler/libsolutil/IpfsHash.cpp | 162 +- compiler/libsolutil/IpfsHash.h | 1 + compiler/libsolutil/JSON.cpp | 55 +- compiler/libsolutil/JSON.h | 28 +- compiler/libsolutil/Keccak256.cpp | 24 +- compiler/libsolutil/Keccak256.h | 1 + compiler/libsolutil/LEB128.h | 59 + compiler/libsolutil/LazyInit.h | 95 + .../ErrorCheck.h => libsolutil/Numeric.cpp} | 27 +- compiler/libsolutil/Numeric.h | 182 + compiler/libsolutil/Result.h | 3 +- compiler/libsolutil/SetOnce.h | 88 + .../StackTooDeepString.h} | 23 +- compiler/libsolutil/StringUtils.cpp | 2 +- compiler/libsolutil/StringUtils.h | 123 +- compiler/libsolutil/SwarmHash.cpp | 3 +- compiler/libsolutil/SwarmHash.h | 1 + compiler/libsolutil/UTF8.cpp | 5 +- compiler/libsolutil/UTF8.h | 1 + .../Views.h} | 23 +- compiler/libsolutil/Visitor.h | 14 +- compiler/libsolutil/Whiskers.cpp | 57 +- compiler/libsolutil/Whiskers.h | 13 +- compiler/libsolutil/cxx20.h | 63 + compiler/libsolutil/picosha2.h | 551 +- compiler/libsolutil/vector_ref.h | 51 +- compiler/scripts/ASTImportTest.sh | 100 +- compiler/scripts/Dockerfile | 3 +- compiler/scripts/build_emscripten.sh | 14 +- .../scripts/bytecodecompare/prepare_report.js | 118 + .../scripts/bytecodecompare/prepare_report.py | 448 +- .../scripts/bytecodecompare/storebytecode.sh | 119 +- compiler/scripts/check_style.sh | 69 +- compiler/scripts/check_symlinks.sh | 17 + .../chk_shellscripts/chk_shellscripts.sh | 17 + compiler/scripts/ci/base64DecToArr.js | 46 + compiler/scripts/ci/build.sh | 32 + compiler/scripts/ci/build_emscripten.sh | 91 + compiler/scripts/ci/build_ossfuzz.sh | 27 + .../ci/buildpack-deps_test_emscripten.sh | 1 + ...pack-deps_test_ubuntu1604.clang.ossfuzz.sh | 1 + .../ci/buildpack-deps_test_ubuntu1804.sh | 1 + .../buildpack-deps_test_ubuntu2004.clang.sh | 1 + .../ci/buildpack-deps_test_ubuntu2004.sh | 1 + compiler/scripts/ci/docker_upgrade.sh | 77 + compiler/scripts/ci/mini-lz4.js | 116 + compiler/scripts/ci/pack_soljson.sh | 37 + .../scripts/ci/post_style_errors_on_github.sh | 55 + compiler/scripts/codespell_ignored_lines.txt | 20 + compiler/scripts/codespell_whitelist.txt | 12 +- compiler/scripts/common.sh | 248 +- compiler/scripts/common/git_helpers.py | 19 + compiler/scripts/common/rest_api_helpers.py | 189 + compiler/scripts/common_cmdline.sh | 105 + compiler/scripts/create_source_tarball.sh | 14 +- compiler/scripts/deps-ppa/static_z3.sh | 123 +- .../buildpack-deps/Dockerfile.emscripten | 76 + .../Dockerfile.ubuntu1604.clang.ossfuzz | 138 + .../buildpack-deps/Dockerfile.ubuntu2004 | 75 + .../Dockerfile.ubuntu2004.clang | 77 + .../scripts/docker/buildpack-deps/README.md | 39 + .../buildpack-deps}/emscripten.jam | 8 +- compiler/scripts/docker_build.sh | 12 - compiler/scripts/docker_deploy.sh | 29 - compiler/scripts/docker_deploy_manual.sh | 10 +- compiler/scripts/docs_version_pragma_check.sh | 199 + .../endToEndExtraction/create_traces.sh | 25 + .../endToEndExtraction/remove-testcases.py | 183 + .../endToEndExtraction/verify-testcases.py | 214 + compiler/scripts/error_codes.py | 350 + .../scripts/externalTests/benchmark_diff.py | 453 + .../externalTests/download_benchmarks.py | 194 + .../scripts/externalTests/merge_benchmarks.sh | 60 + .../externalTests/parse_eth_gas_report.py | 269 + .../externalTests/summarize_benchmarks.sh | 53 + .../externalTests/update_external_repos.sh | 122 + compiler/scripts/extract_test_cases.py | 6 +- compiler/scripts/gas_diff_stats.py | 140 + ...e_emscripten.sh => get_nightly_version.sh} | 22 +- compiler/scripts/get_version.sh | 13 +- compiler/scripts/install_cmake.sh | 7 +- compiler/scripts/install_deps.bat | 61 - compiler/scripts/install_deps.cmake | 99 - compiler/scripts/install_deps.ps1 | 28 + compiler/scripts/install_evmone.ps1 | 9 + .../scripts/install_obsolete_jsoncpp_1_7_4.sh | 22 +- compiler/scripts/isolate_tests.py | 176 +- compiler/scripts/isoltest.sh | 2 +- compiler/scripts/pylint_all.py | 110 +- compiler/scripts/pylintrc | 28 +- compiler/scripts/regressions.py | 74 +- compiler/scripts/release.bat | 38 - compiler/scripts/release.sh | 56 - compiler/scripts/release_ppa.sh | 125 +- compiler/scripts/report_errors.sh | 49 - compiler/scripts/run_proofs.sh | 20 +- .../bytecode_reports_for_modified_binaries.sh | 184 + .../solc-bin/compare_bytecode_reports.sh | 64 + compiler/scripts/soltest.sh | 35 +- compiler/scripts/splitSources.py | 71 +- compiler/scripts/test_antlr_grammar.sh | 157 + compiler/scripts/test_emscripten.sh | 6 +- compiler/scripts/tests.sh | 129 +- .../travis-emscripten/build_emscripten.sh | 96 - .../scripts/travis-emscripten/deploy_key.enc | Bin 1680 -> 0 bytes .../scripts/travis-emscripten/install_deps.sh | 49 - compiler/scripts/uniqueErrors.sh | 14 +- compiler/scripts/update_bugs_by_version.py | 33 +- compiler/scripts/wasm-rebuild/README | 4 + .../docker-scripts/genbytecode.sh | 98 + .../docker-scripts/isolate_tests.py | 63 + .../wasm-rebuild/docker-scripts/patch.sh | 8 + .../docker-scripts/rebuild_current.sh | 74 + .../docker-scripts/rebuild_tags.sh | 246 + compiler/scripts/wasm-rebuild/rebuild.sh | 28 + compiler/scripts/yul_coverage.sh | 152 + compiler/snap/snapcraft.yaml | 21 +- compiler/solc/CMakeLists.txt | 20 +- compiler/solc/CommandLineInterface.cpp | 815 +- compiler/solc/CommandLineInterface.h | 130 +- compiler/solc/CommandLineParser.cpp | 1001 ++ compiler/solc/CommandLineParser.h | 293 + .../IsolTestOptions.h => solc/Exceptions.h} | 24 +- compiler/solc/main.cpp | 72 +- compiler/test/.solhint.json | 8 - compiler/test/.solhintignore | 1 - compiler/test/CMakeLists.txt | 183 - compiler/test/Common.cpp | 175 - compiler/test/Common.h | 74 - compiler/test/CommonSyntaxTest.cpp | 252 - compiler/test/CommonSyntaxTest.h | 86 - compiler/test/EVMHost.cpp | 712 - compiler/test/EVMHost.h | 97 - compiler/test/ExecutionFramework.cpp | 245 - compiler/test/ExecutionFramework.h | 294 - compiler/test/InteractiveTests.h | 72 - compiler/test/Metadata.cpp | 203 - compiler/test/Metadata.h | 54 - compiler/test/TestCase.cpp | 205 - compiler/test/TestCase.h | 114 - compiler/test/boostTest.cpp | 206 - compiler/test/buglistTests.js | 134 - compiler/test/buglist_test_vectors.md | 148 - compiler/test/cmdlineTests.sh | 468 - .../cmdlineTests/abiencoderv2_no_warning/args | 1 - .../cmdlineTests/abiencoderv2_no_warning/err | 1 - .../cmdlineTests/abiencoderv2_no_warning/exit | 1 - .../abiencoderv2_no_warning/input.sol | 7 - .../abiencoderv2_no_warning/output | 4 - .../ast_json_import_wrong_evmVersion/args | 1 - .../ast_json_import_wrong_evmVersion/err | 1 - .../ast_json_import_wrong_evmVersion/exit | 1 - .../input.sol | 117 - compiler/test/cmdlineTests/evm_to_wasm/args | 1 - compiler/test/cmdlineTests/evm_to_wasm/err | 1 - .../test/cmdlineTests/evm_to_wasm/input.sol | 3 - compiler/test/cmdlineTests/evm_to_wasm/output | 104 - .../test/cmdlineTests/object_compiler/args | 1 - .../test/cmdlineTests/object_compiler/err | 1 - .../test/cmdlineTests/object_compiler/exit | 1 - .../cmdlineTests/object_compiler/input.sol | 17 - .../test/cmdlineTests/object_compiler/output | 67 - .../output_selection_all_A1/input.json | 21 - .../output_selection_all_A1/output.json | 6 - .../output_selection_all_A2/input.json | 21 - .../output_selection_all_A2/output.json | 6 - .../output_selection_all_blank/input.json | 21 - .../output_selection_all_blank/output.json | 6 - .../output_selection_all_star/input.json | 21 - .../output_selection_all_star/output.json | 6 - .../output_selection_single_A1/input.json | 21 - .../output_selection_single_A1/output.json | 2 - .../output_selection_single_B1/input.json | 21 - .../output_selection_single_B1/output.json | 5 - .../output_selection_single_all/input.json | 21 - .../output_selection_single_all/output.json | 2 - .../recovery_ast_constructor/args | 1 - .../cmdlineTests/recovery_ast_constructor/err | 14 - .../recovery_ast_constructor/input.sol | 17 - .../recovery_ast_constructor/output | 246 - .../recovery_ast_empty_contract/args | 1 - .../recovery_ast_empty_contract/err | 8 - .../recovery_ast_empty_contract/input.sol | 2 - .../recovery_standard_json/input.json | 18 - .../recovery_standard_json/output.json | 7 - .../test/cmdlineTests/require_overload/err | 7 - .../test/cmdlineTests/require_overload/exit | 1 - .../cmdlineTests/require_overload/input.sol | 6 - .../standard_default_success/exit | 1 - .../standard_default_success/input.json | 10 - .../standard_default_success/output.json | 1 - .../standard_eWasm_requested/input.json | 22 - .../standard_eWasm_requested/output.json | 84 - .../standard_irOptimized_requested/input.json | 17 - .../output.json | 55 - .../standard_ir_requested/input.json | 17 - .../standard_ir_requested/output.json | 85 - .../input.json | 17 - .../output.json | 1 - .../exit | 1 - .../input.json | 19 - .../output.json | 1 - .../standard_only_ast_requested/input.json | 17 - .../standard_only_ast_requested/output.json | 1 - .../input.json | 16 - .../output.json | 1 - .../input.json | 16 - .../output.json | 1 - .../standard_optimizer_no_yul/input.json | 17 - .../standard_optimizer_no_yul/output.json | 1 - .../standard_optimizer_yul/input.json | 16 - .../standard_optimizer_yul/output.json | 1 - .../standard_optimizer_yulDetails/input.json | 16 - .../standard_optimizer_yulDetails/output.json | 1 - .../input.json | 16 - .../output.json | 1 - .../input.json | 16 - .../output.json | 1 - .../standard_secondary_source_location/exit | 1 - .../input.json | 10 - .../output.json | 10 - .../standard_wrong_key_auxiliary_input/exit | 1 - .../input.json | 14 - .../output.json | 1 - .../standard_wrong_key_metadata/exit | 1 - .../standard_wrong_key_metadata/input.json | 22 - .../standard_wrong_key_metadata/output.json | 1 - .../standard_wrong_key_optimizer/exit | 1 - .../standard_wrong_key_optimizer/input.json | 22 - .../standard_wrong_key_optimizer/output.json | 1 - .../cmdlineTests/standard_wrong_key_root/exit | 1 - .../standard_wrong_key_root/input.json | 11 - .../standard_wrong_key_root/output.json | 1 - .../standard_wrong_key_settings/exit | 1 - .../standard_wrong_key_settings/input.json | 22 - .../standard_wrong_key_settings/output.json | 1 - .../standard_wrong_key_source/exit | 1 - .../standard_wrong_key_source/input.json | 11 - .../standard_wrong_key_source/output.json | 1 - .../standard_wrong_type_auxiliary_input/exit | 1 - .../input.json | 11 - .../output.json | 1 - .../exit | 1 - .../input.json | 20 - .../output.json | 1 - .../exit | 1 - .../input.json | 23 - .../output.json | 1 - .../standard_wrong_type_metadata/exit | 1 - .../standard_wrong_type_metadata/input.json | 19 - .../standard_wrong_type_metadata/output.json | 1 - .../standard_wrong_type_optimizer/exit | 1 - .../standard_wrong_type_optimizer/input.json | 18 - .../standard_wrong_type_optimizer/output.json | 1 - .../standard_wrong_type_output_selection/exit | 1 - .../input.json | 11 - .../output.json | 1 - .../exit | 1 - .../input.json | 16 - .../output.json | 1 - .../exit | 1 - .../input.json | 13 - .../output.json | 1 - .../exit | 1 - .../input.json | 16 - .../output.json | 1 - .../standard_wrong_type_remappings/exit | 1 - .../standard_wrong_type_remappings/input.json | 17 - .../output.json | 1 - .../standard_wrong_type_remappings_entry/exit | 1 - .../input.json | 17 - .../output.json | 1 - .../standard_wrong_type_root/exit | 1 - .../standard_wrong_type_root/input.json | 1 - .../standard_wrong_type_root/output.json | 1 - .../standard_wrong_type_settings/exit | 1 - .../standard_wrong_type_settings/input.json | 23 - .../standard_wrong_type_settings/output.json | 1 - .../standard_wrong_type_source/exit | 1 - .../standard_wrong_type_source/input.json | 12 - .../standard_wrong_type_source/output.json | 1 - .../standard_wrong_type_sources/exit | 1 - .../standard_wrong_type_sources/input.json | 4 - .../standard_wrong_type_sources/output.json | 1 - .../exit | 1 - .../input.json | 21 - .../output.json | 1 - .../test/cmdlineTests/standard_yul/input.json | 17 - .../cmdlineTests/standard_yul/output.json | 29 - .../input.json | 17 - .../output.json | 1 - .../input.json | 17 - .../output.json | 1 - .../standard_yul_multiple_files/input.json | 21 - .../standard_yul_multiple_files/output.json | 1 - .../input.json | 21 - .../output.json | 1 - .../standard_yul_object/input.json | 17 - .../standard_yul_object/output.json | 30 - .../standard_yul_object_name/input.json | 17 - .../standard_yul_object_name/output.json | 45 - .../standard_yul_optimized/input.json | 23 - .../standard_yul_optimized/output.json | 17 - .../storage_layout_bytes/input.json | 16 - .../storage_layout_bytes/output.json | 2 - .../storage_layout_dyn_array/input.json | 16 - .../storage_layout_dyn_array/output.json | 2 - .../storage_layout_many/input.json | 16 - .../storage_layout_many/output.json | 2 - .../storage_layout_mapping/input.json | 16 - .../storage_layout_mapping/output.json | 2 - .../storage_layout_smoke/input.json | 16 - .../storage_layout_smoke/output.json | 2 - .../input.json | 19 - .../output.json | 2 - .../storage_layout_string/input.json | 16 - .../storage_layout_string/output.json | 2 - .../storage_layout_struct/input.json | 16 - .../storage_layout_struct/output.json | 2 - .../storage_layout_struct_packed/input.json | 16 - .../storage_layout_struct_packed/output.json | 2 - .../storage_layout_value_types/input.json | 16 - .../storage_layout_value_types/output.json | 2 - .../input.json | 16 - .../output.json | 2 - .../test/cmdlineTests/strict_asm_jump/args | 1 - .../test/cmdlineTests/strict_asm_jump/err | 6 - .../test/cmdlineTests/strict_asm_jump/exit | 1 - .../cmdlineTests/strict_asm_jump/input.sol | 1 - compiler/test/cmdlineTests/too_long_line/err | 8 - compiler/test/cmdlineTests/too_long_line/exit | 1 - .../test/cmdlineTests/too_long_line/input.sol | 4 - .../too_long_line_both_sides_short/err | 8 - .../too_long_line_both_sides_short/exit | 1 - .../too_long_line_both_sides_short/input.sol | 5 - .../cmdlineTests/too_long_line_edge_in/err | 8 - .../cmdlineTests/too_long_line_edge_in/exit | 1 - .../too_long_line_edge_in/input.sol | 4 - .../cmdlineTests/too_long_line_edge_out/err | 8 - .../cmdlineTests/too_long_line_edge_out/exit | 1 - .../too_long_line_edge_out/input.sol | 4 - .../cmdlineTests/too_long_line_left_short/err | 8 - .../too_long_line_left_short/exit | 1 - .../too_long_line_left_short/input.sol | 4 - .../cmdlineTests/too_long_line_multiline/err | 8 - .../cmdlineTests/too_long_line_multiline/exit | 1 - .../too_long_line_multiline/input.sol | 13 - .../too_long_line_right_short/err | 8 - .../too_long_line_right_short/exit | 1 - .../too_long_line_right_short/input.sol | 5 - compiler/test/cmdlineTests/yul_stack_opt/args | 1 - compiler/test/cmdlineTests/yul_stack_opt/err | 1 - .../test/cmdlineTests/yul_stack_opt/input.sol | 24 - .../test/cmdlineTests/yul_stack_opt/output | 202 - .../cmdlineTests/yul_stack_opt_disabled/args | 1 - .../cmdlineTests/yul_stack_opt_disabled/err | 5 - .../cmdlineTests/yul_stack_opt_disabled/exit | 1 - .../yul_stack_opt_disabled/input.sol | 24 - .../yul_stack_opt_disabled/output | 30 - .../yul_string_format_ascii/input.json | 17 - .../yul_string_format_ascii/output.json | 154 - .../input.json | 17 - .../output.json | 107 - .../input.json | 17 - .../output.json | 131 - .../yul_string_format_ascii_long/input.json | 17 - .../yul_string_format_ascii_long/output.json | 162 - .../yul_string_format_hex/input.json | 17 - .../yul_string_format_hex/output.json | 131 - .../MultiSigWallet/Factory.sol | 28 - .../compilationTests/MultiSigWallet/LICENSE | 674 - .../MultiSigWallet/MultiSigWallet.sol | 366 - .../MultiSigWallet/MultiSigWalletFactory.sol | 21 - .../MultiSigWalletWithDailyLimit.sol | 97 - .../MultiSigWalletWithDailyLimitFactory.sol | 22 - .../compilationTests/MultiSigWallet/README.md | 3 - .../MultiSigWallet/TestToken.sol | 76 - compiler/test/compilationTests/README.md | 5 - compiler/test/compilationTests/corion/LICENSE | 674 - .../test/compilationTests/corion/README.md | 3 - .../corion/announcementTypes.sol | 35 - compiler/test/compilationTests/corion/ico.sol | 376 - .../test/compilationTests/corion/module.sol | 146 - .../compilationTests/corion/moduleHandler.sol | 448 - .../compilationTests/corion/multiOwner.sol | 83 - .../test/compilationTests/corion/owned.sol | 28 - .../test/compilationTests/corion/premium.sol | 346 - .../test/compilationTests/corion/provider.sol | 799 - .../compilationTests/corion/publisher.sol | 278 - .../test/compilationTests/corion/safeMath.sol | 33 - .../compilationTests/corion/schelling.sol | 579 - .../test/compilationTests/corion/token.sol | 518 - .../test/compilationTests/corion/tokenDB.sol | 77 - .../gnosis/Events/CategoricalEvent.sol | 55 - .../compilationTests/gnosis/Events/Event.sol | 128 - .../gnosis/Events/EventFactory.sol | 79 - .../gnosis/Events/ScalarEvent.sol | 89 - compiler/test/compilationTests/gnosis/LICENSE | 675 - .../gnosis/MarketMakers/LMSRMarketMaker.sol | 185 - .../gnosis/MarketMakers/MarketMaker.sol | 14 - .../gnosis/Markets/Campaign.sol | 176 - .../gnosis/Markets/CampaignFactory.sol | 39 - .../gnosis/Markets/Market.sol | 47 - .../gnosis/Markets/MarketFactory.sol | 20 - .../gnosis/Markets/StandardMarket.sol | 201 - .../gnosis/Markets/StandardMarketFactory.sol | 26 - .../compilationTests/gnosis/Migrations.sol | 23 - .../gnosis/Oracles/CentralizedOracle.sol | 92 - .../Oracles/CentralizedOracleFactory.sol | 27 - .../gnosis/Oracles/DifficultyOracle.sol | 65 - .../Oracles/DifficultyOracleFactory.sol | 27 - .../gnosis/Oracles/FutarchyOracle.sol | 171 - .../gnosis/Oracles/FutarchyOracleFactory.sol | 95 - .../gnosis/Oracles/MajorityOracle.sol | 92 - .../gnosis/Oracles/MajorityOracleFactory.sol | 27 - .../gnosis/Oracles/Oracle.sol | 9 - .../gnosis/Oracles/SignedMessageOracle.sol | 104 - .../Oracles/SignedMessageOracleFactory.sol | 31 - .../gnosis/Oracles/UltimateOracle.sol | 197 - .../gnosis/Oracles/UltimateOracleFactory.sol | 64 - .../test/compilationTests/gnosis/README.md | 3 - .../gnosis/Tokens/EtherToken.sol | 47 - .../gnosis/Tokens/OutcomeToken.sol | 63 - .../gnosis/Tokens/StandardToken.sol | 108 - .../compilationTests/gnosis/Tokens/Token.sol | 23 - .../compilationTests/gnosis/Utils/Math.sol | 341 - .../compilationTests/milestonetracker/LICENSE | 675 - .../milestonetracker/MilestoneTracker.sol | 367 - .../milestonetracker/README.md | 3 - .../compilationTests/milestonetracker/RLP.sol | 411 - .../test/compilationTests/stringutils/LICENSE | 201 - .../compilationTests/stringutils/README.md | 4 - .../compilationTests/stringutils/strings.sol | 716 - compiler/test/contracts/AuctionRegistrar.cpp | 456 - compiler/test/contracts/ContractInterface.h | 96 - compiler/test/contracts/FixedFeeRegistrar.cpp | 250 - compiler/test/contracts/Wallet.cpp | 703 - compiler/test/docsCodeStyle.sh | 49 - compiler/test/evmc/CMakeLists.txt | 22 - compiler/test/evmc/LICENSE | 202 - compiler/test/evmc/README.md | 3 - compiler/test/evmc/evmc.h | 941 - compiler/test/evmc/evmc.hpp | 770 - compiler/test/evmc/helpers.h | 212 - compiler/test/evmc/loader.c | 319 - compiler/test/evmc/loader.h | 170 - compiler/test/evmc/mocked_host.hpp | 315 - compiler/test/evmc/utils.h | 36 - compiler/test/externalTests.sh | 50 - compiler/test/externalTests/colony.sh | 48 - compiler/test/externalTests/common.sh | 296 - compiler/test/externalTests/gnosis.sh | 48 - .../test/externalTests/solc-js/DAO/DAO.sol | 946 - .../solc-js/DAO/ManagedAccount.sol | 68 - .../test/externalTests/solc-js/DAO/Token.sol | 151 - .../solc-js/DAO/TokenCreation.sol | 156 - .../test/externalTests/solc-js/determinism.js | 45 - .../test/externalTests/solc-js/solc-js.sh | 59 - compiler/test/externalTests/zeppelin.sh | 42 - compiler/test/formal/README.md | 6 - compiler/test/formal/checked_int_add.py | 39 - compiler/test/formal/checked_int_div.py | 35 - compiler/test/formal/checked_int_mul_16.py | 42 - compiler/test/formal/checked_int_sub.py | 39 - compiler/test/formal/checked_uint_add.py | 35 - compiler/test/formal/checked_uint_mul_16.py | 36 - compiler/test/formal/checked_uint_sub.py | 35 - .../test/formal/combine_div_shl_one_32.py | 24 - .../test/formal/combine_mul_shl_one_64.py | 30 - .../formal/combine_shl_shr_by_constant_64.py | 44 - .../formal/combine_shr_shl_by_constant_64.py | 44 - .../test/formal/move_and_across_shl_128.py | 36 - .../test/formal/move_and_across_shr_128.py | 36 - compiler/test/formal/opcodes.py | 52 - compiler/test/formal/rule.py | 44 - compiler/test/formal/shl_workaround_8.py | 27 - .../formal/sub_not_zero_x_to_not_x_256.py | 26 - compiler/test/formal/util.py | 27 - compiler/test/libevmasm/Assembler.cpp | 144 - compiler/test/libevmasm/Optimiser.cpp | 1371 -- compiler/test/liblangutil/CharStream.cpp | 52 - compiler/test/liblangutil/SourceLocation.cpp | 50 - compiler/test/libsolidity/ABIDecoderTests.cpp | 966 -- compiler/test/libsolidity/ABIEncoderTests.cpp | 787 - .../test/libsolidity/ABIJson/basic_test.sol | 28 - .../libsolidity/ABIJson/constructor_abi.sol | 29 - .../libsolidity/ABIJson/empty_contract.sol | 4 - ...ty_name_input_parameter_with_named_one.sol | 42 - .../ABIJson/empty_name_return_parameters.sol | 30 - .../libsolidity/ABIJson/event_structs.sol | 64 - compiler/test/libsolidity/ABIJson/events.sol | 78 - .../libsolidity/ABIJson/events_anonymous.sol | 13 - .../libsolidity/ABIJson/function_type.sol | 21 - .../ABIJson/function_type_extended.sol | 21 - .../libsolidity/ABIJson/global_struct.sol | 54 - .../ABIJson/include_fallback_function.sol | 11 - .../test/libsolidity/ABIJson/inherited.sol | 122 - .../libsolidity/ABIJson/library_function.sol | 40 - .../libsolidity/ABIJson/multiple_methods.sol | 50 - .../ABIJson/multiple_methods_order.sol | 51 - .../libsolidity/ABIJson/multiple_params.sol | 33 - .../ABIJson/payable_constructor_abi.sol | 29 - .../ABIJson/payable_fallback_function.sol | 11 - .../libsolidity/ABIJson/payable_function.sol | 22 - .../libsolidity/ABIJson/pure_function.sol | 55 - .../receive_ether_and_fallback_function.sol | 16 - .../ABIJson/receive_ether_function.sol | 11 - .../ABIJson/return_param_in_abi.sol | 39 - .../libsolidity/ABIJson/return_structs.sol | 51 - .../ABIJson/return_structs_with_contracts.sol | 42 - .../ABIJson/structs_and_arrays.sol | 32 - .../ABIJson/structs_in_libraries.sol | 51 - .../libsolidity/ABIJson/view_function.sol | 55 - compiler/test/libsolidity/ABIJsonTest.cpp | 104 - compiler/test/libsolidity/ABIJsonTest.h | 51 - .../ASTJSON/abstract_contract.json | 72 - .../libsolidity/ASTJSON/abstract_contract.sol | 6 - .../ASTJSON/abstract_contract_legacy.json | 112 - .../libsolidity/ASTJSON/address_payable.json | 593 - .../libsolidity/ASTJSON/address_payable.sol | 11 - .../ASTJSON/address_payable_legacy.json | 636 - .../libsolidity/ASTJSON/array_type_name.json | 78 - .../libsolidity/ASTJSON/array_type_name.sol | 3 - .../ASTJSON/array_type_name_legacy.json | 91 - .../libsolidity/ASTJSON/assembly/call.json | 170 - .../libsolidity/ASTJSON/assembly/call.sol | 7 - .../ASTJSON/assembly/call_legacy.json | 123 - .../ASTJSON/assembly/function.json | 157 - .../libsolidity/ASTJSON/assembly/function.sol | 7 - .../ASTJSON/assembly/function_legacy.json | 123 - .../libsolidity/ASTJSON/assembly/leave.json | 107 - .../libsolidity/ASTJSON/assembly/leave.sol | 7 - .../ASTJSON/assembly/leave_legacy.json | 123 - .../libsolidity/ASTJSON/assembly/loop.json | 170 - .../libsolidity/ASTJSON/assembly/loop.sol | 7 - .../ASTJSON/assembly/loop_legacy.json | 123 - .../ASTJSON/assembly/nested_functions.json | 166 - .../ASTJSON/assembly/nested_functions.sol | 12 - .../assembly/nested_functions_legacy.json | 148 - .../ASTJSON/assembly/slot_offset.json | 238 - .../ASTJSON/assembly/slot_offset.sol | 9 - .../ASTJSON/assembly/slot_offset_legacy.json | 213 - .../ASTJSON/assembly/stringlit.json | 111 - .../ASTJSON/assembly/stringlit.sol | 7 - .../ASTJSON/assembly/stringlit_legacy.json | 123 - .../libsolidity/ASTJSON/assembly/switch.json | 219 - .../libsolidity/ASTJSON/assembly/switch.sol | 12 - .../ASTJSON/assembly/switch_legacy.json | 136 - .../ASTJSON/assembly/var_access.json | 162 - .../ASTJSON/assembly/var_access.sol | 8 - .../ASTJSON/assembly/var_access_legacy.json | 175 - .../test/libsolidity/ASTJSON/constructor.json | 72 - .../test/libsolidity/ASTJSON/constructor.sol | 6 - .../ASTJSON/constructor_legacy.json | 112 - .../ASTJSON/contract_dep_order.json | 238 - .../ASTJSON/contract_dep_order.sol | 7 - .../ASTJSON/contract_dep_order_legacy.json | 293 - .../libsolidity/ASTJSON/documentation.json | 217 - .../libsolidity/ASTJSON/documentation.sol | 19 - .../ASTJSON/documentation_legacy.json | 206 - .../test/libsolidity/ASTJSON/enum_value.json | 58 - .../test/libsolidity/ASTJSON/enum_value.sol | 3 - .../ASTJSON/enum_value_legacy.json | 79 - .../libsolidity/ASTJSON/event_definition.json | 51 - .../libsolidity/ASTJSON/event_definition.sol | 3 - .../ASTJSON/event_definition_legacy.json | 75 - .../test/libsolidity/ASTJSON/fallback.json | 72 - .../test/libsolidity/ASTJSON/fallback.sol | 6 - .../ASTJSON/fallback_and_reveice_ether.json | 108 - .../ASTJSON/fallback_and_reveice_ether.sol | 8 - .../fallback_and_reveice_ether_legacy.json | 176 - .../libsolidity/ASTJSON/fallback_legacy.json | 112 - .../libsolidity/ASTJSON/fallback_payable.json | 72 - .../libsolidity/ASTJSON/fallback_payable.sol | 5 - .../ASTJSON/fallback_payable_legacy.json | 112 - .../libsolidity/ASTJSON/function_type.json | 231 - .../libsolidity/ASTJSON/function_type.sol | 3 - .../ASTJSON/function_type_legacy.json | 273 - .../test/libsolidity/ASTJSON/global_enum.json | 32 - .../test/libsolidity/ASTJSON/global_enum.sol | 3 - .../ASTJSON/global_enum_legacy.json | 41 - .../libsolidity/ASTJSON/global_struct.json | 58 - .../libsolidity/ASTJSON/global_struct.sol | 3 - .../ASTJSON/global_struct_legacy.json | 64 - .../ASTJSON/inheritance_specifier.json | 82 - .../ASTJSON/inheritance_specifier.sol | 3 - .../ASTJSON/inheritance_specifier_legacy.json | 107 - .../long_type_name_binary_operation.json | 179 - .../long_type_name_binary_operation.sol | 3 - ...ong_type_name_binary_operation_legacy.json | 212 - .../ASTJSON/long_type_name_identifier.json | 186 - .../ASTJSON/long_type_name_identifier.sol | 3 - .../long_type_name_identifier_legacy.json | 225 - .../test/libsolidity/ASTJSON/mappings.json | 227 - .../test/libsolidity/ASTJSON/mappings.sol | 8 - .../libsolidity/ASTJSON/mappings_legacy.json | 248 - .../ASTJSON/modifier_definition.json | 180 - .../ASTJSON/modifier_definition.sol | 3 - .../ASTJSON/modifier_definition_legacy.json | 218 - .../ASTJSON/modifier_invocation.json | 180 - .../ASTJSON/modifier_invocation.sol | 3 - .../ASTJSON/modifier_invocation_legacy.json | 218 - .../test/libsolidity/ASTJSON/non_utf8.json | 126 - .../test/libsolidity/ASTJSON/non_utf8.sol | 3 - .../libsolidity/ASTJSON/non_utf8_legacy.json | 160 - .../test/libsolidity/ASTJSON/override.json | 375 - .../test/libsolidity/ASTJSON/override.sol | 13 - .../libsolidity/ASTJSON/override_legacy.json | 536 - .../ASTJSON/placeholder_statement.json | 67 - .../ASTJSON/placeholder_statement.sol | 3 - .../ASTJSON/placeholder_statement_legacy.json | 90 - .../libsolidity/ASTJSON/receive_ether.json | 72 - .../libsolidity/ASTJSON/receive_ether.sol | 6 - .../ASTJSON/receive_ether_legacy.json | 112 - .../libsolidity/ASTJSON/short_type_name.json | 130 - .../libsolidity/ASTJSON/short_type_name.sol | 3 - .../ASTJSON/short_type_name_legacy.json | 167 - .../ASTJSON/short_type_name_ref.json | 142 - .../ASTJSON/short_type_name_ref.sol | 3 - .../ASTJSON/short_type_name_ref_legacy.json | 180 - compiler/test/libsolidity/ASTJSON/smoke.json | 34 - compiler/test/libsolidity/ASTJSON/smoke.sol | 3 - .../libsolidity/ASTJSON/smoke_legacy.json | 49 - .../libsolidity/ASTJSON/source_location.json | 164 - .../libsolidity/ASTJSON/source_location.sol | 3 - .../ASTJSON/source_location_legacy.json | 203 - .../ASTJSON/two_base_functions.json | 282 - .../ASTJSON/two_base_functions.sol | 11 - .../ASTJSON/two_base_functions_legacy.json | 392 - .../ASTJSON/using_for_directive.json | 89 - .../ASTJSON/using_for_directive.sol | 3 - .../ASTJSON/using_for_directive_legacy.json | 112 - compiler/test/libsolidity/ASTJSONTest.cpp | 252 - compiler/test/libsolidity/ASTJSONTest.h | 52 - .../test/libsolidity/AnalysisFramework.cpp | 153 - compiler/test/libsolidity/AnalysisFramework.h | 154 - compiler/test/libsolidity/Assembly.cpp | 208 - compiler/test/libsolidity/ErrorCheck.cpp | 83 - compiler/test/libsolidity/GasCosts.cpp | 199 - compiler/test/libsolidity/GasMeter.cpp | 364 - compiler/test/libsolidity/GasTest.cpp | 186 - compiler/test/libsolidity/GasTest.h | 54 - compiler/test/libsolidity/Imports.cpp | 116 - compiler/test/libsolidity/InlineAssembly.cpp | 750 - compiler/test/libsolidity/LibSolc.cpp | 183 - compiler/test/libsolidity/Metadata.cpp | 307 - compiler/test/libsolidity/SMTChecker.cpp | 143 - .../test/libsolidity/SMTCheckerJSONTest.cpp | 167 - .../test/libsolidity/SMTCheckerJSONTest.h | 47 - compiler/test/libsolidity/SMTCheckerTest.cpp | 71 - compiler/test/libsolidity/SMTCheckerTest.h | 49 - compiler/test/libsolidity/SemVerMatcher.cpp | 239 - compiler/test/libsolidity/SemanticTest.cpp | 223 - compiler/test/libsolidity/SemanticTest.h | 72 - .../test/libsolidity/SolidityCompiler.cpp | 56 - .../test/libsolidity/SolidityEndToEndTest.cpp | 14457 ---------------- .../SolidityExecutionFramework.cpp | 90 - .../libsolidity/SolidityExecutionFramework.h | 76 - .../SolidityExpressionCompiler.cpp | 645 - .../SolidityNameAndTypeResolution.cpp | 530 - .../test/libsolidity/SolidityNatspecJSON.cpp | 979 -- .../test/libsolidity/SolidityOptimizer.cpp | 714 - compiler/test/libsolidity/SolidityParser.cpp | 695 - compiler/test/libsolidity/SolidityScanner.cpp | 665 - compiler/test/libsolidity/SolidityTypes.cpp | 290 - .../test/libsolidity/StandardCompiler.cpp | 1368 -- compiler/test/libsolidity/SyntaxTest.cpp | 129 - compiler/test/libsolidity/SyntaxTest.h | 60 - compiler/test/libsolidity/ViewPureChecker.cpp | 132 - .../constructor_recovers.sol | 20 - .../errorRecoveryTests/contract_recovery.sol | 7 - .../do_not_delete_at_error.sol | 13 - .../errorRecoveryTests/error_to_eos.sol | 23 - .../errorRecoveryTests/missing_rhs.sol | 11 - .../errorRecoveryTests/multiple_errors.sol | 29 - compiler/test/libsolidity/gasTests/abiv2.sol | 30 - .../libsolidity/gasTests/abiv2_optimised.sol | 33 - .../libsolidity/gasTests/data_storage.sol | 20 - .../libsolidity/gasTests/dispatch_large.sol | 52 - .../gasTests/dispatch_large_optimised.sol | 55 - .../libsolidity/gasTests/dispatch_medium.sol | 26 - .../gasTests/dispatch_medium_optimised.sol | 29 - .../libsolidity/gasTests/dispatch_small.sol | 16 - .../gasTests/dispatch_small_optimised.sol | 19 - .../abiDecodeV1/decode_slice.sol | 9 - .../abiDecodeV1/dynamic_memory_copy.sol | 26 - .../abiEncoderV2/calldata_array.sol | 22 - .../abiEncoderV2/calldata_array_dynamic.sol | 33 - .../calldata_array_dynamic_index_access.sol | 34 - .../calldata_array_dynamic_static_dynamic.sol | 49 - ...data_array_dynamic_static_short_decode.sol | 11 - ...ta_array_dynamic_static_short_reencode.sol | 13 - .../calldata_array_function_types.sol | 30 - .../calldata_array_multi_dynamic.sol | 31 - .../abiEncoderV2/calldata_array_static.sol | 25 - .../calldata_array_static_dynamic_static.sol | 49 - .../calldata_array_static_index_access.sol | 25 - .../calldata_array_struct_dynamic.sol | 16 - .../calldata_array_two_dynamic.sol | 20 - .../calldata_array_two_static.sol | 20 - .../abiEncoderV2/calldata_struct_dynamic.sol | 18 - .../calldata_struct_member_offset.sol | 23 - .../abiEncoderV2/calldata_struct_simple.sol | 18 - .../abiEncoderV2/cleanup/address.sol | 31 - .../abiEncoderV2/cleanup/bool.sol | 21 - .../abiEncoderV2/cleanup/bytesx.sol | 115 - .../abiEncoderV2/cleanup/dynamic_array.sol | 22 - .../abiEncoderV2/cleanup/function.sol | 28 - .../abiEncoderV2/cleanup/intx.sol | 155 - .../abiEncoderV2/cleanup/simple_struct.sol | 24 - .../abiEncoderV2/cleanup/static_array.sol | 23 - .../abiEncoderV2/cleanup/uintx.sol | 115 - .../abiEncoderV2/storage_array_encoding.sol | 21 - .../array/calldata_slice_access.sol | 44 - .../semanticTests/array/push_no_args_1d.sol | 32 - .../semanticTests/array/push_no_args_2d.sol | 39 - .../array/push_no_args_bytes.sol | 28 - .../array/push_no_args_struct.sol | 44 - .../asmForLoop/for_loop_break.sol | 15 - .../asmForLoop/for_loop_continue.sol | 15 - .../asmForLoop/for_loop_nested.sol | 22 - .../blockhash_shadow_resolution.sol | 8 - .../semanticTests/c99_scoping_activation.sol | 43 - .../semanticTests/ecrecover/ecrecover.sol | 12 - .../ecrecover/ecrecover_abiV2.sol | 13 - .../failing_ecrecover_invalid_input.sol | 10 - .../failing_ecrecover_invalid_input_asm.sol | 15 - ...failing_ecrecover_invalid_input_proper.sol | 20 - .../semanticTests/empty_contract.sol | 6 - .../exponentiation/signed_base.sol | 14 - .../exponentiation/small_exp.sol | 13 - .../expressions/bytes_comparison.sol | 12 - ...conditional_expression_different_types.sol | 10 - .../conditional_expression_false_literal.sol | 7 - .../conditional_expression_functions.sol | 12 - .../conditional_expression_multiple.sol | 13 - ...onditional_expression_storage_memory_1.sol | 27 - ...onditional_expression_storage_memory_2.sol | 28 - .../conditional_expression_true_literal.sol | 7 - .../conditional_expression_tuples.sol | 8 - ...ditional_expression_with_return_values.sol | 8 - .../expressions/exp_operator_const.sol | 7 - .../expressions/exp_operator_const_signed.sol | 7 - .../expressions/exp_zero_literal.sol | 7 - .../expressions/inc_dec_operators.sol | 17 - .../uncalled_address_transfer_send.sol | 12 - .../fallback/fallback_or_receive.sol | 17 - .../semanticTests/fallback/inherited.sol | 10 - .../fallback/short_data_calls_fallback.sol | 17 - .../array_multiple_local_vars.sol | 28 - .../functionCall/base_base_overload.sol | 50 - .../functionCall/base_overload.sol | 29 - .../functionCall/disordered_named_args.sol | 8 - .../mapping_array_internal_argument.sol | 23 - .../mapping_internal_argument.sol | 21 - .../functionCall/mapping_internal_return.sol | 22 - .../functionCall/member_accessors.sol | 22 - .../functionCall/multiple_functions.sol | 12 - .../functionCall/multiple_return_values.sol | 9 - .../semanticTests/functionCall/named_args.sol | 6 - .../functionCall/named_args_overload.sol | 34 - .../functionCall/transaction_status.sol | 9 - .../function_selector_via_contract_name.sol | 20 - .../semanticTests/inlineAssembly/chainid.sol | 12 - .../inlineAssembly/constant_access.sol | 18 - .../constant_access_referencing.sol | 26 - .../semanticTests/inlineAssembly/leave.sol | 14 - .../inlineAssembly/selfbalance.sol | 12 - .../inlineAssembly/truefalse.sol | 12 - .../interface_inheritance_conversions.sol | 39 - .../libraries/library_address.sol | 56 - .../libraries/library_address_homestead.sol | 24 - .../library_delegatecall_guard_pure.sol | 32 - ...library_delegatecall_guard_view_needed.sol | 32 - ...ary_delegatecall_guard_view_not_needed.sol | 31 - ...ary_delegatecall_guard_view_staticcall.sol | 31 - .../libraries/library_function_selectors.sol | 30 - .../library_function_selectors_struct.sol | 27 - .../semanticTests/libraries/stub.sol | 13 - .../semanticTests/libraries/stub_internal.sol | 12 - .../literals/hex_string_with_underscore.sol | 7 - .../receive/empty_calldata_calls_receive.sol | 12 - .../semanticTests/receive/ether_and_data.sol | 6 - .../semanticTests/receive/inherited.sol | 12 - .../revertStrings/array_slices.sol | 11 - .../semanticTests/revertStrings/bubble.sol | 15 - .../calldata_array_dynamic_invalid.sol | 11 - ...data_array_dynamic_static_short_decode.sol | 12 - ...ta_array_dynamic_static_short_reencode.sol | 14 - .../calldata_array_invalid_length.sol | 11 - .../calldata_arrays_too_large.sol | 11 - .../revertStrings/calldata_too_short.sol | 11 - .../called_contract_has_code.sol | 12 - .../semanticTests/revertStrings/enum.sol | 12 - .../ether_non_payable_function.sol | 9 - .../revertStrings/function_entry_checks.sol | 9 - .../invalid_abi_decoding_calldata_v1.sol | 13 - .../invalid_abi_decoding_memory_v1.sol | 20 - .../revertStrings/library_non_view_call.sol | 16 - .../revertStrings/short_input_array.sol | 9 - .../revertStrings/short_input_bytes.sol | 9 - .../semanticTests/revertStrings/transfer.sol | 27 - .../revertStrings/unknown_sig_no_fallback.sol | 8 - .../salted_create/salted_create.sol | 23 - .../salted_create_with_value.sol | 23 - .../test/libsolidity/semanticTests/shifts.sol | 10 - .../semanticTests/smoke/alignment.sol | 29 - .../semanticTests/smoke/arrays.sol | 44 - .../libsolidity/semanticTests/smoke/basic.sol | 40 - .../semanticTests/smoke/bytes_and_strings.sol | 22 - .../semanticTests/smoke/constructor.sol | 18 - .../semanticTests/smoke/failure.sol | 23 - .../semanticTests/smoke/fallback.sol | 23 - .../semanticTests/smoke/multiline.sol | 14 - .../smoke/multiline_comments.sol | 20 - .../semanticTests/smoke/structs.sol | 22 - .../test/libsolidity/semanticTests/snark.sol | 297 - .../abi_functions_member_access.sol | 11 - .../state_var_initialization.sol | 14 - .../statements/do_while_loop_continue.sol | 16 - .../storage/accessors_mapping_for_array.sol | 15 - .../semanticTests/storage/array_accessor.sol | 33 - .../semanticTests/storage/chop_sign_bits.sol | 29 - .../storage/complex_accessors.sol | 17 - .../storage/mappings_array2d_pop_delete.sol | 39 - .../storage/mappings_array_pop_delete.sol | 34 - .../semanticTests/storage/simple_accessor.sol | 8 - .../storage/state_smoke_test.sol | 23 - .../semanticTests/storage/struct_accessor.sol | 12 - .../structs/array_of_recursive_struct.sol | 12 - .../structs/calldata/dynamic_nested.sol | 11 - .../structs/calldata/dynamically_encoded.sol | 10 - .../conversion/assignment_ignore_mapping.sol | 50 - .../conversion/recursive_storage_memory.sol | 25 - .../recursive_storage_memory_complex.sol | 50 - .../semanticTests/structs/delete_struct.sol | 49 - .../semanticTests/structs/global.sol | 10 - .../structs/struct_reference.sol | 24 - .../semanticTests/structs/structs.sol | 33 - .../semanticTests/tryCatch/assert.sol | 16 - .../semanticTests/tryCatch/create.sol | 32 - .../tryCatch/invalid_error_encoding.sol | 168 - .../semanticTests/tryCatch/lowLevel.sol | 18 - .../semanticTests/tryCatch/nested.sol | 33 - .../tryCatch/return_function.sol | 17 - .../semanticTests/tryCatch/simple.sol | 18 - .../semanticTests/tryCatch/structured.sol | 19 - .../tryCatch/structuredAndLowLevel.sol | 23 - .../semanticTests/tryCatch/trivial.sol | 16 - .../types/assign_calldata_value_type.sol | 9 - ...ixed_bytes_to_fixed_bytes_greater_size.sol | 9 - ...t_fixed_bytes_to_fixed_bytes_same_size.sol | 9 - ...ixed_bytes_to_fixed_bytes_smaller_size.sol | 9 - ...nvert_fixed_bytes_to_uint_greater_size.sol | 9 - ...vert_fixed_bytes_to_uint_same_min_size.sol | 9 - .../convert_fixed_bytes_to_uint_same_type.sol | 9 - ...nvert_fixed_bytes_to_uint_smaller_size.sol | 9 - ...nvert_uint_to_fixed_bytes_greater_size.sol | 9 - ...vert_uint_to_fixed_bytes_same_min_size.sol | 9 - .../convert_uint_to_fixed_bytes_same_size.sol | 9 - ...nvert_uint_to_fixed_bytes_smaller_size.sol | 9 - .../types/external_function_to_address.sol | 11 - .../types/mapping_contract_key.sol | 28 - .../types/mapping_contract_key_getter.sol | 38 - .../types/mapping_contract_key_library.sol | 35 - .../semanticTests/types/mapping_enum_key.sol | 30 - .../types/mapping_enum_key_getter.sol | 40 - .../types/mapping_enum_key_getter_v2.sol | 39 - .../types/mapping_enum_key_library.sol | 35 - .../semanticTests/types/mapping_simple.sol | 27 - .../types/packing_signed_types.sol | 8 - .../types/packing_unpacking_types.sol | 10 - .../semanticTests/types/strings.sol | 15 - .../types/type_conversion_cleanup.sol | 7 - .../invalidInConstructor.sol | 23 - .../invalidStoredInConstructor.sol | 23 - .../uninitializedFunctionPointer/store2.sol | 39 - .../storeInConstructor.sol | 19 - .../semanticTests/variables/delete_local.sol | 11 - .../semanticTests/variables/delete_locals.sol | 14 - .../variables/mapping_local_assignment.sol | 15 - .../mapping_local_compound_assignment.sol | 14 - .../mapping_local_tuple_assignment.sol | 16 - .../variables/public_state_overridding.sol | 19 - .../viaYul/array_memory_as_parameter.sol | 26 - .../viaYul/array_memory_create.sol | 13 - .../viaYul/array_memory_index_access.sol | 35 - .../viaYul/array_push_return_reference.sol | 25 - .../viaYul/array_push_with_arg.sol | 25 - .../viaYul/array_storage_index_access.sol | 28 - .../array_storage_index_boundary_test.sol | 23 - .../array_storage_index_zeroed_test.sol | 59 - .../viaYul/array_storage_length_access.sol | 18 - .../viaYul/array_storage_pop_zero_length.sol | 11 - .../viaYul/array_storage_push_empty.sol | 17 - ...rray_storage_push_empty_length_address.sol | 23 - .../viaYul/array_storage_push_pop.sol | 20 - .../semanticTests/viaYul/assert.sol | 22 - .../viaYul/assert_and_require.sol | 19 - .../semanticTests/viaYul/comparison.sol | 74 - .../viaYul/comparison_functions.sol | 29 - .../conversion/explicit_cast_assignment.sol | 10 - .../explicit_cast_function_call.sol | 12 - .../explicit_cast_local_assignment.sol | 10 - .../conversion/implicit_cast_assignment.sol | 14 - .../implicit_cast_function_call.sol | 17 - .../implicit_cast_local_assignment.sol | 13 - .../semanticTests/viaYul/delete.sol | 25 - .../viaYul/detect_add_overflow.sol | 18 - .../viaYul/detect_add_overflow_signed.sol | 37 - .../viaYul/detect_div_overflow.sol | 27 - .../semanticTests/viaYul/detect_mod_zero.sol | 25 - .../viaYul/detect_mod_zero_signed.sol | 35 - .../viaYul/detect_mul_overflow.sol | 37 - .../viaYul/detect_mul_overflow_signed.sol | 58 - .../viaYul/detect_sub_overflow.sol | 17 - .../viaYul/detect_sub_overflow_signed.sol | 42 - .../semanticTests/viaYul/erc20.sol | 104 - .../viaYul/function_entry_checks.sol | 30 - .../libsolidity/semanticTests/viaYul/if.sol | 82 - .../semanticTests/viaYul/keccak.sol | 14 - .../viaYul/local_address_assignment.sol | 10 - .../semanticTests/viaYul/local_assignment.sol | 10 - .../viaYul/local_bool_assignment.sol | 10 - .../semanticTests/viaYul/loops/break.sol | 31 - .../semanticTests/viaYul/loops/continue.sol | 37 - .../semanticTests/viaYul/loops/return.sol | 34 - .../semanticTests/viaYul/loops/simple.sol | 39 - .../viaYul/mapping_enum_key_getter.sol | 26 - .../semanticTests/viaYul/mapping_getters.sol | 40 - .../semanticTests/viaYul/msg_sender.sol | 11 - .../semanticTests/viaYul/require.sol | 44 - .../semanticTests/viaYul/return.sol | 10 - .../viaYul/return_and_convert.sol | 11 - .../semanticTests/viaYul/short_circuit.sol | 17 - .../viaYul/simple_assignment.sol | 10 - .../viaYul/simple_inline_asm.sol | 17 - .../semanticTests/viaYul/smoke_test.sol | 6 - .../semanticTests/viaYul/storage/mappings.sol | 39 - .../viaYul/storage/packed_storage.sol | 16 - .../viaYul/storage/simple_storage.sol | 17 - .../semanticTests/viaYul/string_format.sol | 13 - .../semanticTests/viaYul/string_literals.sol | 29 - .../semanticTests/viaYul/unary_operations.sol | 136 - .../viaYul/various_inline_asm.sol | 23 - .../viaYul/virtual_functions.sol | 32 - .../smtCheckerTests/complex/MerkleProof.sol | 42 - .../complex/slither/const_state_variables.sol | 57 - .../complex/slither/data_dependency.sol | 139 - .../complex/slither/external_function.sol | 89 - .../complex/warn_on_struct.sol | 14 - .../complex/warn_on_typecast.sol | 8 - .../assignment_in_declaration.sol | 4 - .../branches_assert_condition_1.sol | 12 - .../branches_assert_condition_2.sol | 16 - .../branches_merge_variables_1.sol | 10 - .../branches_merge_variables_2.sol | 11 - .../branches_merge_variables_3.sol | 12 - .../branches_merge_variables_4.sol | 13 - .../branches_merge_variables_5.sol | 13 - .../branches_merge_variables_6.sol | 13 - .../function_call_inside_branch.sol | 20 - .../function_call_inside_branch_2.sol | 27 - .../function_call_inside_branch_3.sol | 27 - .../function_call_inside_branch_4.sol | 31 - .../function_call_inside_else_branch.sol | 21 - .../function_call_inside_modifier_branch.sol | 24 - ...ide_placeholder_inside_modifier_branch.sol | 25 - .../control_flow/short_circuit_and.sol | 18 - .../control_flow/short_circuit_and_fail.sol | 19 - .../short_circuit_and_inside_branch.sol | 28 - .../short_circuit_and_need_both.sol | 18 - .../short_circuit_and_need_both_fail.sol | 19 - .../short_circuit_and_touched.sol | 19 - .../short_circuit_and_touched_function.sol | 23 - .../control_flow/short_circuit_or.sol | 18 - .../control_flow/short_circuit_or_fail.sol | 19 - .../short_circuit_or_inside_branch.sol | 28 - .../short_circuit_or_need_both.sol | 18 - .../short_circuit_or_need_both_fail.sol | 19 - .../control_flow/short_circuit_or_touched.sol | 19 - .../short_circuit_or_touched_function.sol | 23 - .../ways_to_merge_variables_1.sol | 12 - .../ways_to_merge_variables_2.sol | 12 - .../ways_to_merge_variables_3.sol | 12 - .../functions/abi_encode_functions.sol | 11 - .../functions/constructor_base_basic.sol | 15 - .../functions/constructor_hierarchy.sol | 16 - .../functions/constructor_hierarchy_2.sol | 7 - .../functions/constructor_hierarchy_3.sol | 22 - .../functions/constructor_hierarchy_4.sol | 23 - .../constructor_hierarchy_diamond.sol | 29 - .../constructor_hierarchy_diamond_2.sol | 29 - .../constructor_hierarchy_diamond_3.sol | 34 - ...tructor_hierarchy_diamond_empty_middle.sol | 23 - ...rarchy_diamond_empty_middle_empty_base.sol | 19 - .../constructor_hierarchy_empty_chain.sol | 22 - .../constructor_hierarchy_empty_middle.sol | 20 - ...r_hierarchy_empty_middle_no_invocation.sol | 19 - .../constructor_hierarchy_mixed_chain.sol | 30 - ...uctor_hierarchy_mixed_chain_empty_base.sol | 24 - ...uctor_hierarchy_mixed_chain_local_vars.sol | 35 - ...ctor_hierarchy_mixed_chain_with_params.sol | 29 - ...or_hierarchy_mixed_chain_with_params_2.sol | 27 - .../constructor_hierarchy_modifier.sol | 17 - .../constructor_hierarchy_same_var.sol | 16 - .../functions/constructor_simple.sol | 16 - .../functions/constructor_state_value.sol | 16 - .../constructor_state_value_inherited.sol | 18 - .../constructor_state_value_parameter.sol | 17 - .../functions/constructor_this.sol | 13 - ...unction_call_does_not_clear_local_vars.sol | 13 - .../function_call_state_var_init.sol | 13 - .../functions/function_inline_chain.sol | 41 - ...unction_inside_branch_modify_state_var.sol | 19 - ...ction_inside_branch_modify_state_var_2.sol | 18 - ...ction_inside_branch_modify_state_var_3.sol | 28 - .../functions/functions_bound_1.sol | 19 - .../functions/functions_bound_1_fail.sol | 21 - .../functions/functions_external_1.sol | 20 - .../functions/functions_external_2.sol | 20 - .../functions/functions_external_3.sol | 21 - .../functions/functions_external_4.sol | 19 - .../functions/functions_identity_1.sol | 13 - .../functions/functions_identity_1_fail.sol | 15 - .../functions/functions_identity_2.sol | 17 - .../functions/functions_identity_2_fail.sol | 19 - .../functions/functions_identity_as_tuple.sol | 14 - .../functions_identity_as_tuple_fail.sol | 15 - .../functions/functions_library_1.sol | 20 - .../functions/functions_library_1_fail.sol | 21 - .../functions/functions_recursive.sol | 17 - .../functions_recursive_indirect.sol | 26 - .../functions/functions_storage_var_1.sol | 14 - .../functions_storage_var_1_fail.sol | 16 - .../functions/functions_storage_var_2.sol | 15 - .../functions_storage_var_2_fail.sol | 17 - .../functions_trivial_condition_for.sol | 8 - ...ctions_trivial_condition_for_only_call.sol | 7 - .../functions_trivial_condition_if.sol | 7 - .../functions_trivial_condition_require.sol | 8 - ...ns_trivial_condition_require_only_call.sol | 7 - .../functions_trivial_condition_while.sol | 8 - ...ions_trivial_condition_while_only_call.sol | 7 - .../functions/recursive_multi_return.sol | 12 - .../functions/recursive_multi_return_2.sol | 28 - .../functions/this_external_call.sol | 14 - .../functions/this_external_call_return.sol | 15 - .../smtCheckerTests/functions/this_fake.sol | 24 - .../smtCheckerTests/functions/this_state.sol | 15 - ...ctor_hierarchy_mixed_chain_with_params.sol | 29 - .../constructor_state_variable_init.sol | 11 - .../constructor_state_variable_init_base.sol | 14 - .../constructor_state_variable_init_chain.sol | 22 - ...or_state_variable_init_chain_alternate.sol | 21 - ...ctor_state_variable_init_chain_run_all.sol | 27 - ...or_state_variable_init_chain_run_all_2.sol | 26 - ...onstructor_state_variable_init_diamond.sol | 20 - ...tor_state_variable_init_diamond_middle.sol | 22 - ...ctor_state_variable_init_function_call.sol | 17 - .../smtCheckerTests/inheritance/fallback.sol | 27 - .../inheritance/fallback_receive.sol | 28 - .../inheritance/functions_1.sol | 25 - .../inheritance/functions_2.sol | 27 - .../inheritance/functions_3.sol | 47 - .../implicit_constructor_hierarchy.sol | 18 - .../implicit_only_constructor_hierarchy.sol | 22 - .../smtCheckerTests/inheritance/receive.sol | 27 - .../inheritance/receive_fallback.sol | 28 - .../inheritance/state_variables.sol | 17 - .../inheritance/state_variables_2.sol | 19 - .../inheritance/state_variables_3.sol | 18 - .../smtCheckerTests/inline_assembly/empty.sol | 11 - .../inline_assembly/local_var.sol | 13 - .../smtCheckerTests/invariants/loop_basic.sol | 13 - .../invariants/loop_basic_for.sol | 11 - .../invariants/loop_nested.sol | 19 - .../invariants/loop_nested_for.sol | 16 - .../invariants/state_machine_1.sol | 34 - .../invariants/state_machine_1_fail.sol | 34 - .../smtCheckerTests/loops/do_while_1_fail.sol | 18 - .../loops/do_while_1_false_positives.sol | 19 - .../smtCheckerTests/loops/do_while_break.sol | 17 - .../loops/do_while_break_2.sol | 21 - .../loops/do_while_break_2_fail.sol | 22 - .../loops/do_while_break_fail.sol | 18 - .../loops/do_while_continue.sol | 16 - .../smtCheckerTests/loops/for_1_break.sol | 19 - .../loops/for_1_break_fail.sol | 20 - .../smtCheckerTests/loops/for_1_continue.sol | 17 - .../loops/for_1_continue_fail.sol | 20 - .../smtCheckerTests/loops/for_1_fail.sol | 18 - .../loops/for_1_false_positive.sol | 21 - .../loops/for_break_direct.sol | 14 - .../smtCheckerTests/loops/for_loop_1.sol | 10 - .../smtCheckerTests/loops/for_loop_2.sol | 10 - .../smtCheckerTests/loops/for_loop_3.sol | 10 - .../smtCheckerTests/loops/for_loop_4.sol | 12 - .../smtCheckerTests/loops/for_loop_5.sol | 14 - .../smtCheckerTests/loops/for_loop_6.sol | 13 - ...or_loop_array_assignment_memory_memory.sol | 22 - ...r_loop_array_assignment_memory_storage.sol | 23 - ...r_loop_array_assignment_storage_memory.sol | 23 - ..._loop_array_assignment_storage_storage.sol | 24 - .../loops/for_loop_trivial_condition_1.sol | 12 - .../loops/for_loop_trivial_condition_2.sol | 15 - .../loops/for_loop_trivial_condition_3.sol | 19 - .../loops/for_loop_unreachable_1.sol | 12 - .../smtCheckerTests/loops/while_1.sol | 18 - .../smtCheckerTests/loops/while_1_break.sol | 19 - .../loops/while_1_break_fail.sol | 21 - .../loops/while_1_continue.sol | 18 - .../loops/while_1_continue_fail.sol | 24 - .../smtCheckerTests/loops/while_1_fail.sol | 16 - .../loops/while_1_infinite.sol | 22 - .../smtCheckerTests/loops/while_2.sol | 15 - .../smtCheckerTests/loops/while_2_break.sol | 18 - .../loops/while_2_break_fail.sol | 18 - .../smtCheckerTests/loops/while_2_fail.sol | 16 - .../loops/while_break_direct.sol | 15 - ...le_loop_array_assignment_memory_memory.sol | 24 - ...e_loop_array_assignment_memory_storage.sol | 27 - ..._loop_array_assignment_storage_storage.sol | 26 - .../loops/while_loop_simple_1.sol | 15 - .../loops/while_loop_simple_2.sol | 11 - .../loops/while_loop_simple_3.sol | 13 - .../loops/while_loop_simple_4.sol | 11 - .../loops/while_loop_simple_5.sol | 14 - .../loops/while_nested_break.sol | 32 - .../loops/while_nested_break_fail.sol | 35 - .../loops/while_nested_continue.sol | 30 - .../loops/while_nested_continue_fail.sol | 33 - .../modifier_assignment_outside_branch.sol | 19 - .../modifier_code_after_placeholder.sol | 24 - .../modifiers/modifier_control_flow.sol | 18 - ...modifier_inline_function_inside_branch.sol | 21 - .../modifiers/modifier_inside_branch.sol | 13 - .../modifier_inside_branch_assignment.sol | 23 - ...difier_inside_branch_assignment_branch.sol | 27 - ...nside_branch_assignment_multi_branches.sol | 35 - .../modifiers/modifier_multi.sol | 29 - .../modifiers/modifier_multi_functions.sol | 25 - .../modifier_multi_functions_recursive.sol | 22 - .../modifiers/modifier_multi_parameters.sol | 16 - .../modifiers/modifier_overflow.sol | 18 - .../modifiers/modifier_parameter_copy.sol | 15 - .../modifiers/modifier_parameters.sol | 17 - .../modifiers/modifier_return.sol | 20 - .../modifier_same_local_variables.sol | 15 - .../modifiers/modifier_simple.sol | 15 - .../modifiers/modifier_two_invocations.sol | 19 - .../modifiers/modifier_two_placeholders.sol | 26 - .../operators/compound_add.sol | 14 - .../operators/compound_add_array_index.sol | 15 - .../operators/compound_add_chain.sol | 16 - .../operators/compound_add_mapping.sol | 15 - .../compound_assignment_division_1.sol | 12 - .../compound_assignment_division_2.sol | 13 - .../compound_assignment_division_3.sol | 13 - .../operators/compound_bitwise_and_1.sol | 13 - .../operators/compound_bitwise_or_1.sol | 13 - .../operators/compound_bitwise_xor_1.sol | 13 - .../operators/compound_mul.sol | 14 - .../operators/compound_mul_array_index.sol | 15 - .../operators/compound_mul_mapping.sol | 15 - .../operators/compound_shl_1.sol | 13 - .../operators/compound_shr_1.sol | 13 - .../operators/compound_sub.sol | 14 - .../operators/compound_sub_array_index.sol | 15 - .../operators/compound_sub_mapping.sol | 15 - .../operators/delete_array.sol | 18 - .../operators/delete_array_2d.sol | 11 - .../operators/delete_array_index.sol | 17 - .../operators/delete_array_index_2d.sol | 17 - .../operators/delete_function.sol | 24 - .../operators/delete_struct.sol | 30 - .../smtCheckerTests/operators/division_1.sol | 8 - .../smtCheckerTests/operators/division_2.sol | 7 - .../smtCheckerTests/operators/division_3.sol | 9 - .../smtCheckerTests/operators/division_4.sol | 8 - .../smtCheckerTests/operators/division_5.sol | 11 - .../smtCheckerTests/operators/division_6.sol | 13 - .../smtCheckerTests/operators/division_7.sol | 8 - .../division_truncates_correctly_1.sol | 8 - .../division_truncates_correctly_2.sol | 8 - .../division_truncates_correctly_3.sol | 8 - .../division_truncates_correctly_4.sol | 8 - .../division_truncates_correctly_5.sol | 8 - .../operators/index_access_for_bytes.sol | 10 - .../smtCheckerTests/operators/mod.sol | 10 - .../smtCheckerTests/operators/mod_even.sol | 10 - .../smtCheckerTests/operators/mod_n.sol | 10 - .../operators/mod_n_uint16.sol | 10 - .../smtCheckerTests/operators/unary_add.sol | 17 - .../operators/unary_add_array.sol | 18 - .../operators/unary_add_mapping.sol | 18 - .../smtCheckerTests/operators/unary_sub.sol | 17 - .../operators/unary_sub_array.sol | 18 - .../operators/unary_sub_mapping.sol | 18 - .../smtCheckerTests/overflow/overflow_mul.sol | 17 - .../overflow/overflow_mul_signed.sol | 16 - .../smtCheckerTests/overflow/overflow_sum.sol | 18 - .../overflow/overflow_sum_signed.sol | 19 - .../smtCheckerTests/overflow/safe_add_1.sol | 9 - .../smtCheckerTests/overflow/safe_add_2.sol | 10 - .../smtCheckerTests/overflow/safe_sub_1.sol | 10 - .../overflow/simple_overflow.sol | 6 - .../overflow/underflow_sub.sol | 16 - .../overflow/underflow_sub_signed.sol | 21 - .../smtCheckerTests/simple/smoke_test.sol | 3 - .../smtCheckerTests/simple/static_array.sol | 9 - .../special/abi_decode_memory_v2.sol | 16 - .../abi_decode_memory_v2_value_types.sol | 19 - .../special/abi_decode_simple.sol | 24 - .../smtCheckerTests/special/blockhash.sol | 14 - .../smtCheckerTests/special/difficulty.sol | 10 - .../smtCheckerTests/special/gasleft.sol | 14 - .../smtCheckerTests/special/many.sol | 25 - .../smtCheckerTests/special/msg_data.sol | 11 - .../smtCheckerTests/special/msg_sender_1.sol | 10 - .../smtCheckerTests/special/msg_sender_2.sol | 13 - .../special/msg_sender_fail_1.sol | 13 - .../smtCheckerTests/special/msg_sig.sol | 10 - .../smtCheckerTests/special/this.sol | 10 - .../smtCheckerTests/special/this_state.sol | 11 - .../typecast/cast_address_1.sol | 12 - .../typecast/cast_different_size_1.sol | 26 - .../typecast/cast_larger_1.sol | 12 - .../typecast/cast_larger_2.sol | 13 - .../typecast/cast_larger_2_fail.sol | 13 - .../typecast/cast_larger_3.sol | 17 - .../typecast/cast_smaller_1.sol | 12 - .../typecast/cast_smaller_2.sol | 14 - .../typecast/cast_smaller_3.sol | 14 - .../typecast/enum_from_uint.sol | 15 - .../typecast/enum_to_uint_max_value.sol | 12 - ...unction_type_to_function_type_external.sol | 8 - ...unction_type_to_function_type_internal.sol | 13 - ...g_literal_to_fixed_bytes_function_call.sol | 14 - ...string_literal_to_fixed_bytes_modifier.sol | 11 - .../string_literal_to_fixed_bytes_return.sol | 12 - ...ng_literal_to_fixed_bytes_return_multi.sol | 15 - .../smtCheckerTests/types/address_balance.sol | 13 - .../smtCheckerTests/types/address_call.sol | 25 - .../types/address_delegatecall.sol | 25 - .../types/address_staticcall.sol | 25 - .../types/address_transfer.sol | 15 - .../types/address_transfer_2.sol | 19 - .../types/address_transfer_insufficient.sol | 16 - .../types/array_aliasing_memory_1.sol | 31 - .../types/array_aliasing_memory_2.sol | 18 - .../types/array_aliasing_memory_3.sol | 22 - .../types/array_aliasing_storage_1.sol | 45 - .../types/array_aliasing_storage_2.sol | 18 - .../types/array_aliasing_storage_3.sol | 22 - .../types/array_aliasing_storage_4.sol | 19 - .../types/array_aliasing_storage_5.sol | 23 - .../smtCheckerTests/types/array_branch_1d.sol | 14 - .../smtCheckerTests/types/array_branch_2d.sol | 14 - .../smtCheckerTests/types/array_branch_3d.sol | 14 - .../types/array_branches_1d.sol | 15 - .../types/array_branches_2d.sol | 15 - .../types/array_branches_3d.sol | 15 - .../smtCheckerTests/types/array_dynamic_1.sol | 11 - .../types/array_dynamic_1_fail.sol | 13 - .../smtCheckerTests/types/array_dynamic_2.sol | 11 - .../types/array_dynamic_2_fail.sol | 14 - .../smtCheckerTests/types/array_dynamic_3.sol | 11 - .../types/array_dynamic_3_fail.sol | 14 - .../types/array_dynamic_parameter_1.sol | 10 - .../types/array_dynamic_parameter_1_fail.sol | 12 - .../smtCheckerTests/types/array_literal_1.sol | 11 - .../types/array_mapping_aliasing_1.sol | 24 - .../types/array_mapping_aliasing_2.sol | 26 - .../smtCheckerTests/types/array_static_1.sol | 11 - .../types/array_static_1_fail.sol | 13 - .../smtCheckerTests/types/array_static_2.sol | 11 - .../types/array_static_2_fail.sol | 13 - .../smtCheckerTests/types/array_static_3.sol | 11 - .../types/array_static_3_fail.sol | 14 - .../types/array_static_aliasing_memory_5.sol | 18 - .../types/array_static_aliasing_storage_5.sol | 19 - .../types/array_static_mapping_aliasing_1.sol | 24 - .../types/array_static_mapping_aliasing_2.sol | 26 - .../types/array_struct_array_branches_2d.sol | 32 - .../types/bool_int_mixed_1.sol | 9 - .../types/bool_int_mixed_2.sol | 8 - .../types/bool_int_mixed_3.sol | 21 - .../smtCheckerTests/types/bool_simple_1.sol | 8 - .../smtCheckerTests/types/bool_simple_2.sol | 8 - .../smtCheckerTests/types/bool_simple_3.sol | 7 - .../smtCheckerTests/types/bool_simple_4.sol | 10 - .../smtCheckerTests/types/bool_simple_5.sol | 7 - .../smtCheckerTests/types/bool_simple_6.sol | 9 - .../smtCheckerTests/types/bytes_1.sol | 11 - .../smtCheckerTests/types/bytes_2.sol | 9 - .../smtCheckerTests/types/bytes_2_fail.sol | 11 - .../smtCheckerTests/types/contract.sol | 10 - .../smtCheckerTests/types/contract_2.sol | 15 - .../smtCheckerTests/types/contract_3.sol | 10 - .../types/contract_address_conversion.sol | 10 - .../types/contract_address_conversion_2.sol | 11 - .../types/data_location_in_function_type.sol | 5 - .../types/enum_explicit_values.sol | 12 - .../types/enum_explicit_values_2.sol | 14 - .../smtCheckerTests/types/enum_in_library.sol | 15 - .../types/enum_in_library_2.sol | 17 - .../smtCheckerTests/types/enum_in_struct.sol | 19 - .../smtCheckerTests/types/enum_storage_eq.sol | 13 - .../types/enum_transitivity.sol | 12 - .../smtCheckerTests/types/fixed_bytes_1.sol | 16 - .../function_type_array_as_reference_type.sol | 9 - .../types/function_type_arrays.sol | 14 - .../types/function_type_as_argument.sol | 5 - .../types/function_type_call.sol | 13 - .../types/function_type_external_address.sol | 10 - .../types/function_type_members.sol | 11 - .../types/function_type_nested.sol | 22 - .../types/function_type_nested_return.sol | 27 - .../smtCheckerTests/types/mapping_1.sol | 10 - .../smtCheckerTests/types/mapping_1_fail.sol | 13 - .../smtCheckerTests/types/mapping_2.sol | 11 - .../smtCheckerTests/types/mapping_2d_1.sol | 12 - .../types/mapping_2d_1_fail.sol | 13 - .../smtCheckerTests/types/mapping_3.sol | 12 - .../smtCheckerTests/types/mapping_3d_1.sol | 12 - .../types/mapping_3d_1_fail.sol | 13 - .../smtCheckerTests/types/mapping_4.sol | 12 - .../smtCheckerTests/types/mapping_5.sol | 11 - .../types/mapping_aliasing_1.sol | 18 - .../types/mapping_aliasing_2.sol | 28 - .../types/mapping_and_array_of_functions.sol | 7 - .../types/mapping_as_local_var_1.sol | 21 - .../types/mapping_as_parameter_1.sol | 15 - .../types/mapping_equal_keys_1.sol | 10 - .../types/mapping_equal_keys_2.sol | 12 - .../types/mapping_unsupported_key_type_1.sol | 11 - .../types/no_effect_statements.sol | 24 - .../types/rational_large_1.sol | 10 - .../types/storage_value_vars_1.sol | 22 - .../types/storage_value_vars_2.sol | 12 - .../types/storage_value_vars_3.sol | 25 - .../types/storage_value_vars_4.sol | 10 - .../smtCheckerTests/types/string_1.sol | 12 - .../smtCheckerTests/types/string_2.sol | 10 - .../types/string_literal_assignment_1.sol | 13 - .../types/string_literal_assignment_2.sol | 12 - .../types/string_literal_assignment_3.sol | 14 - .../types/string_literal_assignment_4.sol | 18 - .../types/string_literal_assignment_5.sol | 16 - .../types/string_literal_comparison_1.sol | 13 - .../types/string_literal_comparison_2.sol | 13 - .../smtCheckerTests/types/struct_1.sol | 26 - .../types/struct_array_branches_1d.sol | 34 - .../types/struct_array_branches_2d.sol | 34 - .../types/struct_array_branches_3d.sol | 33 - .../types/tuple_assignment.sol | 13 - .../types/tuple_assignment_array.sol | 12 - .../types/tuple_assignment_array_empty.sol | 14 - .../types/tuple_assignment_compound.sol | 13 - .../types/tuple_assignment_empty.sol | 14 - .../types/tuple_assignment_multiple_calls.sol | 14 - .../types/tuple_declarations.sol | 11 - .../types/tuple_declarations_empty.sol | 9 - .../types/tuple_declarations_function.sol | 17 - .../types/tuple_declarations_function_2.sol | 18 - .../tuple_declarations_function_empty.sol | 17 - .../smtCheckerTests/types/tuple_function.sol | 17 - .../types/tuple_function_2.sol | 17 - .../types/tuple_function_3.sol | 19 - .../types/tuple_return_branch.sol | 25 - .../types/type_expression_array_2d.sol | 10 - .../types/type_expression_array_3d.sol | 11 - .../types/type_expression_tuple_array_2d.sol | 11 - .../types/type_expression_tuple_array_3d.sol | 12 - .../constant_condition_1.sol | 9 - .../constant_condition_2.sol | 9 - .../constant_condition_3.sol | 9 - .../verification_target/simple_assert.sol | 6 - .../simple_assert_with_require.sol | 4 - .../simple_assert_with_require_message.sol | 8 - .../smtCheckerTestsJSON/multi.json | 10 - .../libsolidity/smtCheckerTestsJSON/multi.sol | 14 - .../smtCheckerTestsJSON/simple.json | 9 - .../smtCheckerTestsJSON/simple.sol | 11 - ...abstract_contract_because_of_interface.sol | 7 - .../abstract_contract_instantiation.sol | 12 - .../syntaxTests/abstract/abstract_only.sol | 4 - .../abstract/abstract_without_contract.sol | 3 - .../syntaxTests/abstract/contract.sol | 1 - .../syntaxTests/abstract/interface.sol | 4 - .../syntaxTests/abstract/library.sol | 3 - .../abstract/unimplemented_functions.sol | 5 - .../unimplemented_functions_inherited.sol | 7 - .../syntaxTests/array/array_pop.sol | 7 - .../syntaxTests/array/array_pop_arg.sol | 8 - .../syntaxTests/array/bytes_pop.sol | 7 - .../syntaxTests/array/calldata.sol | 5 - .../syntaxTests/array/calldata_assign.sol | 6 - .../syntaxTests/array/calldata_dynamic.sol | 5 - .../syntaxTests/array/calldata_multi.sol | 5 - .../array/calldata_multi_dynamic.sol | 5 - .../array/calldata_multi_dynamic_V1.sol | 7 - .../syntaxTests/array/calldata_resize.sol | 7 - .../syntaxTests/array/contract_array.sol | 11 - .../array/dynamic_memory_array_pop.sol | 8 - .../array/invalid/contract_index_access.sol | 7 - .../array/invalid/library_index_access.sol | 7 - ..._cannot_be_constant_function_parameter.sol | 8 - .../array/length/bytes32_too_large.sol | 5 - .../length/bytes32_too_large_multidim.sol | 5 - .../length/can_be_constant_in_function.sol | 8 - .../length/can_be_constant_in_struct.sol | 7 - .../length/can_be_recursive_constant.sol | 6 - .../array/length/cannot_be_assigned.sol | 8 - .../length/cannot_be_assigned_mapping.sol | 8 - .../length/cannot_be_assigned_struct.sol | 11 - .../array/length/cannot_be_function.sol | 6 - .../array/length/cannot_be_function_call.sol | 7 - .../array/length/complex_cyclic_constant.sol | 10 - .../length/const_cannot_be_fractional.sol | 6 - .../syntaxTests/array/length/constant_var.sol | 5 - .../array/length/cyclic_constant.sol | 8 - .../fixed_size_multidim_zero_length.sol | 15 - .../array/length/fixed_size_zero_length.sol | 15 - .../syntaxTests/array/length/inline_array.sol | 5 - .../array/length/invalid_expression_1.sol | 5 - .../array/length/invalid_expression_2.sol | 5 - .../array/length/invalid_expression_3.sol | 5 - .../array/length/invalid_expression_4.sol | 5 - .../array/length/invalid_expression_5.sol | 5 - .../array/length/non_integer_constant_var.sol | 6 - .../length/not_convertible_to_integer.sol | 5 - .../array/length/not_too_large.sol | 9 - .../array/length/parameter_too_large.sol | 5 - .../length/parameter_too_large_multidim.sol | 11 - .../parameter_too_large_multidim_ABIv2.sol | 9 - .../syntaxTests/array/length/parentheses.sol | 25 - .../array/length/pure_functions.sol | 6 - .../syntaxTests/array/length/too_large.sol | 5 - .../syntaxTests/array/length/tuples.sol | 5 - .../array/length/uint_too_large_multidim.sol | 5 - .../syntaxTests/array/new_no_parentheses.sol | 7 - .../syntaxTests/array/no_array_pop.sol | 8 - .../syntaxTests/array/pop/calldata_pop.sol | 7 - .../syntaxTests/array/pop/memory_pop.sol | 8 - .../syntaxTests/array/push/calldata_push.sol | 7 - .../syntaxTests/array/push/memory_push.sol | 8 - .../array/slice/bytes_calldata.sol | 5 - .../syntaxTests/array/slice/bytes_memory.sol | 7 - .../syntaxTests/array/slice/bytes_storage.sol | 8 - .../array/slice/calldata_dynamic.sol | 5 - .../array/slice/calldata_dynamic_access.sol | 9 - .../calldata_dynamic_convert_to_memory.sol | 7 - .../array/slice/calldata_dynamic_encode.sol | 7 - .../array/slice/calldata_dynamic_forward.sol | 7 - .../array/slice/calldata_static.sol | 7 - .../array/slice/memory_dynamic.sol | 7 - .../syntaxTests/array/slice/memory_static.sol | 7 - .../syntaxTests/array/slice/slice_literal.sol | 7 - .../array/slice/slice_memory_bytes.sol | 8 - .../array/slice/slice_memory_string.sol | 8 - .../syntaxTests/array/slice/slice_string.sol | 7 - .../array/slice/storage_dynamic.sol | 8 - .../array/slice/storage_static.sol | 8 - .../array/static_storage_array_pop.sol | 8 - .../syntaxTests/array/string_pop.sol | 8 - .../array/uninitialized_storage_var.sol | 9 - .../syntaxTests/bound/bound_all.sol | 10 - .../syntaxTests/bound/bound_call.sol | 7 - .../syntaxTests/bound/bound_no_call.sol | 7 - .../syntaxTests/bytecode_too_large.sol | 10 - .../constants/abi_encoding_constant.sol | 7 - .../constants/addmod_mulmod_rational.sol | 7 - .../syntaxTests/constants/addmod_zero.sol | 11 - .../assign_constant_function_value.sol | 6 - .../constants/cyclic_dependency_1.sol | 5 - .../constants/cyclic_dependency_2.sol | 10 - .../constants/cyclic_dependency_3.sol | 11 - .../constants/cyclic_dependency_4.sol | 7 - .../constants/division_by_zero.sol | 9 - .../constants/mod_div_rational.sol | 8 - .../syntaxTests/constants/mod_zero.sol | 9 - .../syntaxTests/constants/mulmod_zero.sol | 11 - .../constants/pure_non_rational.sol | 11 - .../abstract_creation_forward_reference.sol | 15 - .../constructible_internal_constructor.sol | 6 - .../syntaxTests/constructor/constructor.sol | 1 - .../constructor/constructor_no_visibility.sol | 3 - .../constructor/constructor_old.sol | 4 - .../constructor_state_mutability.sol | 9 - .../constructor/constructor_visibility.sol | 13 - .../constructor_without_implementation.sol | 5 - .../constructor/external_constructor.sol | 5 - .../function_named_constructor.sol | 5 - .../inconstructible_internal_constructor.sol | 8 - ...ructible_internal_constructor_inverted.sol | 13 - .../constructor/interface_constructor.sol | 7 - .../constructor/library_constructor.sol | 6 - .../constructor/not_a_contract.sol | 9 - .../constructor/overriding_constructor.sol | 10 - .../constructor/returns_in_constructor.sol | 5 - .../constructor/two_constructors.sol | 6 - .../syntaxTests/constructor_this.sol | 12 - .../controlFlow/mappingReturn/named_err.sol | 5 - .../controlFlow/mappingReturn/named_fine.sol | 5 - .../controlFlow/mappingReturn/unnamed_err.sol | 5 - .../mappingReturn/unnamed_fine.sol | 5 - .../storageReturn/assembly_err.sol | 10 - .../storageReturn/default_location.sol | 19 - .../controlFlow/storageReturn/dowhile_err.sol | 56 - .../storageReturn/dowhile_fine.sol | 32 - .../controlFlow/storageReturn/for_err.sol | 16 - .../controlFlow/storageReturn/for_fine.sol | 13 - .../controlFlow/storageReturn/if_err.sol | 18 - .../controlFlow/storageReturn/if_fine.sol | 29 - .../storageReturn/modifier_err.sol | 22 - .../storageReturn/modifier_fine.sol | 20 - .../controlFlow/storageReturn/revert_fine.sol | 12 - .../storageReturn/short_circuit_err.sol | 18 - .../storageReturn/short_circuit_fine.sol | 11 - .../controlFlow/storageReturn/smoke.sol | 10 - .../controlFlow/storageReturn/ternary_err.sol | 13 - .../storageReturn/ternary_fine.sol | 14 - .../controlFlow/storageReturn/try_err.sol | 34 - .../controlFlow/storageReturn/try_fine.sol | 24 - .../controlFlow/storageReturn/tuple_fine.sol | 15 - .../storageReturn/unimplemented_internal.sol | 5 - .../storageReturn/unimplemented_library.sol | 15 - .../controlFlow/storageReturn/while_err.sol | 11 - .../controlFlow/storageReturn/while_fine.sol | 19 - .../uninitializedAccess/always_revert.sol | 10 - .../uninitializedAccess/assembly.sol | 9 - .../uninitializedAccess/functionType.sol | 8 - .../modifier_order_fail.sol | 8 - .../modifier_order_fine.sol | 6 - .../modifier_post_access.sol | 13 - .../modifier_pre_access.sol | 13 - .../controlFlow/uninitializedAccess/smoke.sol | 10 - .../uninitializedAccess/struct.sol | 11 - .../uninitializedAccess/unreachable.sol | 11 - .../unreachableCode/comment_fine.sol | 6 - .../unreachableCode/constant_condition.sol | 8 - .../unreachableCode/do_while_continue.sol | 12 - .../unreachableCode/double_return.sol | 8 - .../unreachableCode/double_revert.sol | 8 - .../controlFlow/unreachableCode/for_break.sol | 12 - .../unreachableCode/if_both_return.sol | 12 - .../controlFlow/unreachableCode/revert.sol | 8 - .../unreachableCode/revert_empty.sol | 8 - .../unreachableCode/while_break.sol | 12 - .../unreachableCode/while_continue.sol | 11 - .../allowed_conversion_to_bytes_array.sol | 9 - .../allowed_conversion_to_string.sol | 9 - .../conversion/conversion_to_bytes.sol | 5 - ...explicit_conversion_address_to_payable.sol | 11 - ...icit_conversion_from_storage_array_ref.sol | 10 - .../explicit_conversion_sender_to_payable.sol | 9 - .../explicit_conversion_this_to_payable.sol | 8 - .../function_type_nonpayable_payable.sol | 10 - .../function_type_nonpayable_pure.sol | 10 - .../function_type_nonpayable_view.sol | 10 - .../function_type_payable_nonpayable.sol | 8 - .../conversion/function_type_payable_pure.sol | 10 - .../conversion/function_type_payable_view.sol | 10 - .../function_type_pure_nonpayable.sol | 8 - .../conversion/function_type_pure_payable.sol | 10 - .../conversion/function_type_pure_view.sol | 8 - .../conversion/function_type_same.sol | 14 - .../function_type_view_nonpayable.sol | 10 - .../conversion/function_type_view_payable.sol | 10 - .../conversion/function_type_view_pure.sol | 10 - ...icit_conversion_from_storage_array_ref.sol | 7 - .../not_allowed_conversion_from_super.sol | 15 - ...lowed_conversion_to_int_array_pointer1.sol | 10 - ...lowed_conversion_to_int_array_pointer2.sol | 10 - .../data_location_in_function_type.sol | 4 - .../data_location_in_function_type_fail.sol | 9 - ...ion_return_parameters_no_data_location.sol | 5 - ...ation_specifier_test_external_calldata.sol | 4 - ...ocation_specifier_test_external_memory.sol | 5 - ...cation_specifier_test_external_storage.sol | 5 - ...tion_specifier_test_non_reference_type.sol | 5 - ...ion_parameters_with_data_location_fine.sol | 8 - ...urn_parameters_with_data_location_fine.sol | 6 - .../function_type_array_as_reference_type.sol | 8 - ...ation_specifier_test_internal_calldata.sol | 5 - ...ocation_specifier_test_internal_memory.sol | 4 - ...cation_specifier_test_internal_storage.sol | 4 - ...l_function_parameters_no_data_location.sol | 5 - ...ion_return_parameters_no_data_location.sol | 5 - ...ernal_function_params_no_data_location.sol | 12 - ...ernal_function_return_no_data_location.sol | 12 - ...brary_function_with_data_location_fine.sol | 16 - ...ary_internal_function_no_data_location.sol | 20 - ...rary_private_function_no_data_location.sol | 20 - ...brary_public_function_no_data_location.sol | 19 - ...ation_specifier_test_external_calldata.sol | 4 - ...ocation_specifier_test_external_memory.sol | 5 - ...cation_specifier_test_external_storage.sol | 3 - ...ation_specifier_test_internal_calldata.sol | 5 - ...ocation_specifier_test_internal_memory.sol | 3 - ...cation_specifier_test_internal_storage.sol | 3 - .../memory_storage_data_location.sol | 12 - ...e_function_parameters_no_data_location.sol | 5 - ...ion_return_parameters_no_data_location.sol | 5 - ...ocation_specifier_test_public_calldata.sol | 5 - ..._location_specifier_test_public_memory.sol | 4 - ...location_specifier_test_public_storage.sol | 5 - ...c_function_parameters_no_data_location.sol | 5 - ...ion_return_parameters_no_data_location.sol | 5 - ...tion_specifier_test_non_reference_type.sol | 13 - ...location_specifier_test_reference_type.sol | 13 - .../combining_hex_and_denomination.sol | 5 - .../denominations/denominations.sol | 6 - .../denominations/deprecated_year.sol | 5 - .../denominations/fixed_point_division.sol | 6 - .../syntaxTests/deprecated_functions.sol | 12 - .../double_stateVariable_declaration.sol | 6 - .../double_variable_declaration.sol | 9 - .../syntaxTests/emit/emit_empty.sol | 7 - .../syntaxTests/emit/emit_non_event.sol | 10 - .../libsolidity/syntaxTests/empty_struct.sol | 5 - .../syntaxTests/enums/global_enum.sol | 7 - .../enums/global_enum_contract_name_clash.sol | 4 - .../enums/global_enum_name_clash.sol | 4 - .../enums/global_enum_shadowing.sol | 10 - .../events/event_array_indexed_v2.sol | 5 - .../syntaxTests/events/event_array_v2.sol | 5 - .../syntaxTests/events/event_nested_array.sol | 5 - .../events/event_nested_array_2.sol | 4 - .../events/event_nested_array_in_struct.sol | 6 - .../events/event_nested_array_indexed_v2.sol | 5 - .../events/event_nested_array_v2.sol | 5 - .../syntaxTests/events/event_struct.sol | 6 - .../events/event_struct_indexed.sol | 6 - .../events/event_struct_indexed_v2.sol | 6 - .../syntaxTests/events/event_struct_v2.sol | 6 - .../syntaxTests/fallback/arguments.sol | 5 - .../fallback/default_visibility.sol | 7 - .../fallback/fallback_as_function_name.sol | 5 - .../syntaxTests/fallback/old_syntax.sol | 5 - ...ayable_fallback_with_inherited_receive.sol | 6 - ...payable_fallback_without_receive_empty.sol | 3 - ...able_fallback_without_receive_nonempty.sol | 6 - ...ithout_receive_nonempty_by_inheritance.sol | 8 - ...fallback_without_receive_only_internal.sol | 4 - .../syntaxTests/fallback/pure_modifier.sol | 6 - .../fallback/return_value_number.sol | 5 - .../fallback/return_value_type.sol | 5 - .../fallback/return_value_unsupported.sol | 5 - .../syntaxTests/fallback/view_modifier.sol | 6 - ...y_parameters_but_restricted_first_type.sol | 13 - .../functionCalls/call_options_overload.sol | 9 - .../functionCalls/calloptions_duplicated.sol | 17 - .../calloptions_on_delegatecall.sol | 8 - .../calloptions_on_internal_function.sol | 8 - .../functionCalls/calloptions_repeated.sol | 21 - .../invalid_expressions_with_calloptions1.sol | 8 - .../invalid_expressions_with_calloptions2.sol | 8 - .../invalid_expressions_with_calloptions3.sol | 10 - .../functionCalls/lowlevel_call_options.sol | 7 - ...nctions_that_take_arbitrary_parameters.sol | 7 - .../named_arguments_overload.sol | 14 - .../named_arguments_overload_failing1.sol | 14 - .../named_arguments_overload_failing2.sol | 12 - .../named_arguments_overload_failing3.sol | 11 - .../functionCalls/new_with_calloptions.sol | 12 - .../new_with_calloptions_unsupported.sol | 15 - .../new_with_invalid_calloptions.sol | 27 - .../call_value_on_non_constructor.sol | 7 - ...all_value_on_non_payable_function_type.sol | 8 - .../call_value_on_payable_function_type.sol | 6 - .../functionTypes/conversion_to_address.sol | 7 - .../delete_external_function_type_invalid.sol | 7 - .../functionTypes/delete_function_type.sol | 15 - .../delete_function_type_invalid.sol | 7 - ...on_to_function_type_calldata_parameter.sol | 10 - ...external_function_type_public_variable.sol | 11 - ...ernal_function_type_returning_internal.sol | 5 - ...external_function_type_taking_internal.sol | 5 - .../external_function_type_to_address.sol | 5 - ...ernal_function_type_to_address_payable.sol | 7 - .../external_function_type_to_uint.sol | 7 - .../functionTypes/function_type.sol | 6 - .../functionTypes/function_type_arrays.sol | 11 - .../function_type_constructor.sol | 7 - .../function_type_constructor_local.sol | 8 - ...function_type_internal_public_variable.sol | 5 - .../functionTypes/function_type_parameter.sol | 7 - ...tion_type_return_parameters_with_names.sol | 5 - .../functionTypes/function_type_returned.sol | 5 - .../functionTypes/function_type_struct.sol | 8 - .../function_type_struct_undefined_member.sol | 11 - ...nction_type_variable_external_internal.sol | 6 - ...nction_types_internal_visibility_error.sol | 7 - .../function_types_variable_visibility.sol | 9 - ...external_parameter_in_library_external.sol | 6 - ...external_parameter_in_library_external.sol | 6 - ...nternal_function_as_external_parameter.sol | 8 - ...external_parameter_in_library_external.sol | 6 - ...external_parameter_in_library_internal.sol | 4 - ...function_returned_from_public_function.sol | 7 - ...external_parameter_in_library_external.sol | 9 - .../internal_function_type_to_address.sol | 7 - .../payable_internal_function_type.sol | 5 - ...le_internal_function_type_is_not_fatal.sol | 9 - .../functionTypes/private_function_type.sol | 7 - .../functionTypes/public_function_type.sol | 7 - .../valid_function_type_variables.sol | 20 - ...rn_function_type_parameters_with_names.sol | 5 - .../syntaxTests/getter/complex_struct.sol | 7 - .../syntaxTests/getter/nested_structs.sol | 11 - .../syntaxTests/getter/recursive_struct.sol | 8 - .../syntaxTests/getter/simple_struct.sol | 6 - .../call_with_wrong_arg_count.sol | 17 - .../callcode_with_wrong_arg_count.sol | 14 - .../delegatecall_with_wrong_arg_count.sol | 14 - .../keccak256_with_wrong_arg_count.sol | 11 - .../ripemd160_with_wrong_arg_count.sol | 11 - .../sha256_with_wrong_arg_count.sol | 11 - .../globalFunctions/sha3_no_call.sol | 8 - .../globalFunctions/sha3_override.sol | 11 - .../syntaxTests/globalFunctions/sha3_var.sol | 9 - .../globalFunctions/suicide_no_call.sol | 8 - .../globalFunctions/suicide_override.sol | 11 - .../globalFunctions/suicide_var.sol | 9 - .../syntaxTests/imports/circular_import.sol | 4 - .../syntaxTests/imports/complex_import.sol | 5 - .../imports/filename_with_period.sol | 6 - .../import_does_not_clutter_importee.sol | 6 - .../imports/import_is_transitive.sol | 7 - .../imports/inheritance_abi_encoder_match.sol | 20 - .../inheritance_abi_encoder_mismatch_1.sol | 19 - .../inheritance_abi_encoder_mismatch_2.sol | 17 - .../imports/library_name_clash.sol | 8 - .../library_name_clash_with_contract.sol | 4 - .../imports/name_clash_in_import_1.sol | 6 - .../imports/name_clash_in_import_2.sol | 6 - .../imports/name_clash_in_import_3.sol | 6 - .../imports/name_clash_in_import_4.sol | 6 - .../imports/name_clash_in_import_5.sol | 4 - ...name_clash_in_import_contract_struct_1.sol | 7 - ...name_clash_in_import_contract_struct_2.sol | 7 - ...name_clash_in_import_contract_struct_3.sol | 7 - ...name_clash_in_import_contract_struct_4.sol | 7 - ...name_clash_in_import_contract_struct_5.sol | 5 - .../imports/name_clash_in_import_enum.sol | 7 - .../name_clash_in_import_enum_contract.sol | 7 - .../name_clash_in_import_enum_struct.sol | 7 - .../imports/name_clash_in_import_struct_1.sol | 7 - .../imports/name_clash_in_import_struct_2.sol | 7 - .../imports/name_clash_in_import_struct_3.sol | 7 - .../imports/name_clash_in_import_struct_4.sol | 7 - .../imports/name_clash_in_import_struct_5.sol | 5 - ...name_clash_in_import_struct_contract_1.sol | 7 - ...name_clash_in_import_struct_contract_2.sol | 7 - ...name_clash_in_import_struct_contract_3.sol | 7 - ...name_clash_in_import_struct_contract_4.sol | 7 - ...name_clash_in_import_struct_contract_5.sol | 5 - .../syntaxTests/imports/regular_import.sol | 4 - .../syntaxTests/imports/relative_import.sol | 6 - .../imports/relative_import_multiplex.sol | 4 - .../imports/shadowing_builtins_with_alias.sol | 6 - .../shadowing_builtins_with_imports.sol | 8 - ...adowing_builtins_with_multiple_imports.sol | 11 - .../imports/shadowing_via_import.sol | 8 - .../syntaxTests/imports/simple_alias.sol | 4 - .../syntaxTests/imports/smoke_test.sol | 2 - .../indexing/array_multidim_rational.sol | 11 - .../indexing/array_multim_overflow_index.sol | 11 - .../indexing/array_negative_index.sol | 8 - .../indexing/array_noninteger_index.sol | 8 - .../indexing/array_out_of_bounds_index.sol | 8 - .../indexing/array_without_index.sol | 8 - .../indexing/fixedbytes_negative_index.sol | 9 - .../indexing/fixedbytes_noninteger_index.sol | 9 - .../fixedbytes_out_of_bounds_index.sol | 8 - .../indexing/fixedbytes_without_index.sol | 8 - .../syntaxTests/indexing/function_type.sol | 7 - .../indexing/function_type_without_index.sol | 7 - .../struct_array_noninteger_index.sol | 10 - ...mpty_duplicated_super_constructor_call.sol | 2 - .../base_arguments_empty_parentheses.sol | 7 - .../base_arguments_multiple_inheritance.sol | 9 - .../base_arguments_no_parentheses.sol | 5 - ...low_modifier_style_without_parentheses.sol | 4 - .../duplicated_constructor_call/ancestor.sol | 5 - .../duplicated_constructor_call/base.sol | 4 - .../base_multi.sol | 7 - .../base_multi_no_constructor.sol | 6 - ...se_multi_no_constructor_modifier_style.sol | 6 - .../fallback_overrides_receive.sol | 8 - .../fallback_with_override.sol | 6 - .../fallback_with_override_intermediate.sol | 8 - .../fallback_without_override.sol | 8 - ...fallback_without_override_intermediate.sol | 10 - .../receive_overrides_fallback.sol | 8 - .../receive_with_override.sol | 6 - .../receive_with_override_intermediate.sol | 8 - .../receive_without_override.sol | 8 - .../receive_without_override_intermediate.sol | 10 - .../inheritance/interface/contract_base.sol | 5 - .../interface/diamond/diamond_no_relist.sol | 10 - .../interface/diamond/diamond_with_relist.sol | 15 - .../interface/implementation/complete.sol | 17 - .../interface/implementation/partial.sol | 19 - .../linearization/invalid/lists_a.sol | 8 - .../linearization/invalid/lists_b.sol | 8 - .../linearization/invalid/lists_both.sol | 8 - .../interface/linearization/valid.sol | 7 - .../interface/multiple_parents.sol | 15 - .../interface/overrides_multiple.sol | 31 - .../interface/overrides_single.sol | 14 - .../inheritance/interface/single_parent.sol | 5 - .../inheritance/interface_virtual_warning.sol | 5 - .../modifiers_in_constructor_context.sol | 9 - .../inheritance/override/add_view.sol | 5 - ...biguous_base_and_unique_implementation.sol | 20 - .../ambiguous_base_and_unique_mention.sol | 17 - ...ctions_overridden_in_intermediate_base.sol | 12 - ...den_in_intermediate_base_unimplemented.sol | 15 - .../inheritance/override/calldata_memory.sol | 13 - .../override/calldata_memory_conflict.sol | 22 - .../override/calldata_memory_interface.sol | 13 - .../calldata_memory_interface_instantiate.sol | 12 - .../calldata_memory_interface_struct.sol | 16 - .../override/calldata_memory_struct.sol | 16 - .../change_return_types_in_interface.sol | 11 - .../common_base_and_unique_implementation.sol | 17 - .../common_base_and_unique_mention.sol | 12 - .../override/detect_double_override.sol | 7 - ...ate_public_state_variable_and_function.sol | 13 - ...ace_intermediate_public_state_variable.sol | 12 - ...ate_public_state_variable_and_function.sol | 14 - ...tate_variable_and_function_implemented.sol | 14 - ...ate_empty_bottom_public_state_variable.sol | 13 - ...iate_implemented_public_state_variable.sol | 14 - ...ted_intermediate_public_state_variable.sol | 13 - .../external_turns_public_no_params.sol | 7 - .../inheritance/override/function_pointer.sol | 7 - .../override/function_state_variable.sol | 2 - ...implement_interface_by_public_variable.sol | 7 - ...t_internal_function_by_public_variable.sol | 9 - ...nt_private_function_by_public_variable.sol | 10 - ...ent_public_function_by_public_variable.sol | 8 - .../override/internal_external.sol | 6 - .../internal_external_inheritance.sol | 9 - .../override/modifier_ambiguous.sol | 9 - .../override/modifier_ambiguous_fail.sol | 10 - ...modifier_inherited_different_signature.sol | 10 - ...inherited_different_signature_override.sol | 11 - ..._common_base_and_unique_implementation.sol | 13 - ..._common_base_and_unique_implementation.sol | 19 - ...ase_and_unique_implementation_modifier.sol | 19 - ...nd_unique_implementation_unimplemented.sol | 19 - .../inheritance/override/override.sol | 9 - .../override/override_ambiguous.sol | 12 - .../override/override_base_base.sol | 20 - .../override/override_empty_list.sol | 10 - .../override/override_interface.sol | 9 - .../override/override_interface_multiple.sol | 14 - .../override/override_missing_virtual.sol | 11 - .../override_modifier_no_override.sol | 7 - .../override/override_multiple.sol | 18 - .../override/override_multiple2.sol | 15 - .../override/override_multiple_duplicated.sol | 24 - .../override/override_multiple_fail1.sol | 8 - .../override/override_multiple_fail2.sol | 8 - .../override/override_multiple_fail3.sol | 8 - .../override/override_multiple_fail4.sol | 8 - .../override/override_multiple_missing.sol | 22 - .../override/override_multiple_no_virtual.sol | 14 - .../override_multiple_no_virtual2.sol | 13 - .../override/override_multiple_unresolved.sol | 6 - .../override/override_public_vars.sol | 9 - .../override/override_return_mismatch.sol | 12 - .../override/override_shared_base.sol | 15 - .../override/override_shared_base_partial.sol | 10 - .../override/override_shared_base_simple.sol | 6 - .../override/override_type_mismatch.sol | 24 - .../override/override_unimplemented_fail.sol | 15 - .../override/override_unimplemented_fine.sol | 9 - ...blic_var_implements_parallel_interface.sol | 21 - .../override/public_var_missing_override.sol | 11 - .../public_var_no_override_but_function.sol | 9 - .../public_var_overrides_public_var.sol | 9 - .../public_var_overriding_multiple.sol | 10 - ...public_var_overriding_multiple_derived.sol | 12 - .../override/public_var_parallel_funciton.sol | 10 - ...ublic_var_same_name_but_different_args.sol | 7 - .../override/public_var_surplus_override.sol | 9 - .../override/public_vars_multiple.sol | 11 - .../override/public_vars_multiple1.sol | 13 - .../override/public_vars_multiple2.sol | 9 - .../override/public_vars_multiple3.sol | 10 - .../override/public_vars_multiple4.sol | 8 - .../override/public_vars_multiple5.sol | 10 - .../override/public_vars_multiple_diamond.sol | 14 - .../public_vars_multiple_diamond1.sol | 16 - .../public_vars_multiple_diamond2.sol | 17 - ...public_vars_multiple_explicit_override.sol | 10 - .../override/public_vars_wrong_override.sol | 5 - .../inheritance/override/remove_view.sol | 5 - .../override/state_variable_function.sol | 10 - .../inheritance/override/triangle_impl.sol | 6 - .../inheritance/override/triangle_no_impl.sol | 5 - .../inheritance/override/virtual_private.sol | 8 - .../inheritance/reference_non_base_ctor.sol | 6 - .../inheritance/shadowing_base_state_vars.sol | 8 - .../shadowing_private_base_state_vars.sol | 6 - .../inheritance/super_on_external.sol | 10 - .../inheritance/too_few_base_arguments.sol | 10 - .../unimplemented_without_virtual.sol | 5 - .../inheritance/virtual/duplicate.sol | 8 - .../inheritance/virtual/simple.sol | 6 - .../inheritance/wrong_type_base_arguments.sol | 9 - .../assignment_from_contract.sol | 9 - .../assignment_from_functiontype.sol | 7 - .../assignment_from_library.sol | 10 - .../inlineAssembly/assignment_from_super.sol | 9 - .../inlineAssembly/assignment_to_special.sol | 19 - .../inlineAssembly/constant_access.sol | 13 - .../constant_access_non_initialized.sol | 11 - .../inlineAssembly/constant_array.sol | 10 - .../inlineAssembly/constant_bytes_ref.sol | 11 - .../inlineAssembly/constant_computation.sol | 9 - .../inlineAssembly/constant_ref.sol | 10 - .../function_call_invalid_argument_count.sol | 14 - .../function_call_not_found.sol | 9 - .../function_call_to_variable.sol | 11 - .../inlineAssembly/function_without_call.sol | 11 - .../inlineAssembly/in_modifier.sol | 12 - .../invalid/assign_to_instruction.sol | 9 - .../invalid/bare_instructions_disallowed.sol | 10 - .../invalid/calldata_variables.sol | 9 - .../invalid/constant_access.sol | 9 - .../invalid/constant_assignment.sol | 10 - .../invalid/constant_variable_via_offset.sol | 10 - .../invalid/empty_fun_arg_beginning.sol | 11 - .../invalid/empty_fun_arg_end.sol | 11 - .../invalid/empty_fun_arg_middle.sol | 10 - .../invalid/empty_function_name.sol | 9 - .../inlineAssembly/invalid/invalid_number.sol | 9 - .../invalid/jump_disallowed.sol | 9 - .../invalid/label_disallowed.sol | 9 - .../invalid/leave_items_on_tack.sol | 9 - .../invalid/literals_on_stack_disallowed.sol | 9 - ...local_variable_access_out_of_functions.sol | 10 - ...le_access_out_of_functions_storage_ptr.sol | 11 - .../invalid/missing_variable.sol | 9 - .../invalid/missing_variable_in_assign.sol | 10 - .../multiple_assign_to_instruction.sol | 10 - .../invalid/nested_function_local_access.sol | 12 - .../invalid/storage_assignment.sol | 10 - .../storage_assignment_in_modifier.sol | 13 - ...orage_variable_access_out_of_functions.sol | 8 - .../invalid/unbalanced_negative_stack.sol | 9 - .../invalid/unbalanced_positive_stack.sol | 9 - .../invalid/unbalanced_two_stack_load.sol | 8 - .../variable_declaration_suffix_offset.sol | 15 - .../invalid/whitespace_in_assignment.sol | 9 - .../whitespace_in_multiple_assignment.sol | 10 - .../syntaxTests/inlineAssembly/istanbul.sol | 15 - .../inlineAssembly/istanbul_on_petersburg.sol | 19 - .../syntaxTests/inlineAssembly/leave.sol | 10 - .../inlineAssembly/leave_invalid.sol | 9 - .../no_unused_variable_warning.sol | 8 - .../inlineAssembly/overloaded_reference.sol | 11 - .../inlineAssembly/period_in_identifer.sol | 10 - .../inlineAssembly/shadowing/argument.sol | 9 - .../inlineAssembly/shadowing/constant.sol | 10 - .../inlineAssembly/shadowing/contract.sol | 9 - .../inlineAssembly/shadowing/function.sol | 9 - .../shadowing/local_variable.sol | 10 - .../shadowing/name_clash_in_import.sol | 18 - .../shadowing/no_name_clash_in_import.sol | 15 - .../shadowing/qualified_names.sol | 14 - .../inlineAssembly/storage_reference.sol | 11 - .../storage_reference_assignment.sol | 13 - .../storage_reference_empty_offset.sol | 9 - .../storage_reference_empty_slot.sol | 9 - .../inlineAssembly/storage_reference_fine.sol | 11 - .../storage_reference_on_function.sol | 9 - .../storage_reference_on_memory.sol | 13 - .../inlineAssembly/two_stack_slots.sol | 10 - .../use_msize_with_optimizer.sol | 11 - .../use_msize_without_optimizer.sol | 10 - .../inline_arrays/dynamic_inline_array.sol | 8 - ...ration_and_passing_implicit_conversion.sol | 11 - ...nd_passing_implicit_conversion_strings.sol | 10 - ...array_declaration_const_int_conversion.sol | 8 - ...ay_declaration_const_string_conversion.sol | 8 - .../inline_array_declaration_no_type.sol | 7 - ...line_array_declaration_no_type_strings.sol | 7 - .../inline_array_fixed_types.sol | 9 - .../inline_array_of_mapping_type.sol | 8 - .../inline_arrays/inline_array_rationals.sol | 9 - .../invalid_types_in_inline_array.sol | 7 - .../inline_arrays/lvalues_as_inline_array.sol | 8 - .../literalOperations/division_by_zero.sol | 5 - .../division_by_zero_complex.sol | 5 - .../literalOperations/mod_zero.sol | 5 - .../literalOperations/mod_zero_complex.sol | 5 - .../syntaxTests/literal_comparisons.sol | 7 - .../hex_string_duplicate_underscore.sol | 7 - .../hex_string_leading_underscore.sol | 7 - .../hex_string_misaligned_underscore.sol | 7 - .../hex_string_trailing_underscore.sol | 7 - .../literals/hex_string_underscores_valid.sol | 3 - .../lvalues/calldata_index_access.sol | 7 - .../lvalues/calldata_member_access.sol | 9 - .../lvalues/external_reference_argument.sol | 7 - .../syntaxTests/lvalues/functions.sol | 15 - .../syntaxTests/lvalues/library_mapping.sol | 7 - .../syntaxTests/lvalues/valid_lvalues.sol | 31 - .../contract_not_payable_send.sol | 8 - .../contract_not_payable_transfer.sol | 8 - .../memberLookup/failed_function_lookup.sol | 7 - .../failed_function_lookup_in_library.sol | 9 - .../memberLookup/internal_function_type.sol | 7 - .../memberLookup/member_not_unique.sol | 13 - .../memberLookup/member_value_not_unique.sol | 13 - ...tructs_with_mapping_array_struct_array.sol | 12 - .../memory_structs_with_mappings.sol | 10 - .../msg_value_modifier_payable.sol | 4 - .../memberLookup/msg_value_modifier_pure.sol | 6 - .../memberLookup/msg_value_modifier_view.sol | 6 - .../memberLookup/push_on_memory_types.sol | 8 - .../syntaxTests/metaTypes/codeAccess.sol | 12 - .../metaTypes/codeAccessAbstractCreation.sol | 10 - .../metaTypes/codeAccessAbstractRuntime.sol | 10 - .../syntaxTests/metaTypes/codeAccessBase.sol | 22 - .../metaTypes/codeAccessCyclic.sol | 12 - .../metaTypes/codeAccessIsConstant.sol | 7 - .../metaTypes/codeAccessLibrary.sol | 12 - .../syntaxTests/metaTypes/codeIsNoLValue.sol | 10 - .../syntaxTests/metaTypes/name.sol | 5 - .../syntaxTests/metaTypes/name_constant.sol | 4 - .../metaTypes/name_other_contract.sol | 10 - .../syntaxTests/metaTypes/noArgForType.sol | 7 - .../metaTypes/runtimeCodeWarningAssembly.sol | 17 - .../metaTypes/tooManyArgsForType.sol | 7 - .../typeNotRegularIdentifierContractName.sol | 3 - .../typeNotRegularIdentifierFunction.sol | 6 - .../typeNotRegularIdentifierParameter.sol | 6 - .../typeNotRegularIdentifierStateVariable.sol | 5 - .../typeNotRegularIdentifierVariable.sol | 7 - .../syntaxTests/metaTypes/typeOfContract.sol | 7 - .../syntaxTests/metaTypes/typeRecursive.sol | 8 - .../metaTypes/unsupportedArgForType.sol | 9 - .../syntaxTests/missing_state_variable.sol | 7 - .../base_constructor_double_invocation.sol | 7 - .../modifiers/constructor_as_modifier.sol | 5 - .../constructor_call_invalid_arg_count.sol | 9 - .../function_modifier_double_invocation.sol | 4 - .../function_modifier_invocation.sol | 5 - ...on_modifier_invocation_local_variables.sol | 6 - ...unction_modifier_invocation_parameters.sol | 5 - .../modifiers/function_overrides_modifier.sol | 5 - .../modifiers/illegal_modifier_override.sol | 6 - .../invalid_function_modifier_type.sol | 6 - .../modifiers/legal_modifier_override.sol | 2 - .../modifiers/modifier_overrides_function.sol | 5 - .../modifiers/modifier_returns_value.sol | 6 - .../modifiers/modifier_without_underscore.sol | 5 - ..._on_abstract_functions_no_parser_error.sol | 13 - .../non-virtual_modifier_override.sol | 4 - .../modifiers/use_in_invalid_context.sol | 9 - .../more_than_256_declarationerrors.sol | 524 - .../more_than_256_syntaxerrors.sol | 524 - .../multiSource/error_in_first.sol | 10 - .../syntaxTests/multiSource/import.sol | 12 - .../multiSource/import_not_found.sol | 5 - .../syntaxTests/multiSource/no_import.sol | 10 - .../syntaxTests/multiSource/one_source.sol | 7 - .../multiSource/warning_in_both.sol | 11 - .../differentNumberOfComponents.sol | 25 - .../differentNumberOfComponentsFromReturn.sol | 29 - .../disallowWildcards.sol | 24 - .../disallowWildcardsFromReturn.sol | 31 - .../multiSingleVariableDeclaration.sol | 6 - .../multiVariableDeclarationComplex.sol | 11 - .../multiVariableDeclarationEmpty.sol | 11 - .../multiVariableDeclarationInvalidType.sol | 9 - .../multiVariableDeclarationScoping.sol | 10 - .../multiVariableDeclarationScoping2.sol | 11 - .../multiVariableDeclarationSimple.sol | 12 - ...ltiVariableDeclarationThatIsExpression.sol | 9 - .../oneElementTuple.sol | 8 - .../sameNumberOfComponents.sol | 9 - .../syntaxTests/multiline_comments.sol | 13 - .../001_name_references.sol | 6 - .../002_undeclared_name.sol | 8 - .../003_undeclared_name_is_not_fatal.sol | 10 - .../004_reference_to_later_declaration.sol | 5 - .../010_type_conversion_for_comparison.sol | 6 - ...type_conversion_for_comparison_invalid.sol | 5 - .../013_large_string_literal.sol | 6 - .../nameAndTypeResolution/014_balance.sol | 8 - .../015_balance_invalid.sol | 7 - .../017_assignment_to_struct.sol | 11 - .../018_forward_function_reference.sol | 10 - .../019_comparison_bitop_precedence.sol | 7 - .../020_comparison_of_function_types_lt_1.sol | 7 - .../021_comparison_of_function_types_lt_2.sol | 7 - .../022_comparison_of_function_types_gt_1.sol | 7 - .../023_comparison_of_function_types_gt_2.sol | 7 - .../024_comparison_of_function_types_eq.sol | 11 - .../025_comparison_of_mapping_types.sol | 9 - .../029_create_abstract_contract.sol | 7 - ...lemented_abstract_function_as_abstract.sol | 5 - ...ns_with_identical_structs_in_interface.sol | 10 - ...ns_with_different_structs_in_interface.sol | 9 - ...cts_of_non_external_types_in_interface.sol | 8 - ...s_of_non_external_types_in_interface_2.sol | 8 - ...non_external_types_in_interface_nested.sol | 9 - ...rning_multi_dimensional_arrays_new_abi.sol | 6 - ...045_returning_multi_dimensional_arrays.sol | 5 - ...urning_multi_dimensional_static_arrays.sol | 5 - ...47_returning_arrays_in_structs_new_abi.sol | 7 - ...048_returning_arrays_in_structs_arrays.sol | 6 - ...ction_external_call_allowed_conversion.sol | 9 - ...n_external_call_not_allowed_conversion.sol | 10 - ...1_function_internal_allowed_conversion.sol | 11 - ...nction_internal_not_allowed_conversion.sol | 12 - .../053_hash_collision_in_interface.sol | 6 - .../054_inheritance_basic.sol | 5 - .../055_inheritance_diamond_basic.sol | 8 - .../056_cyclic_inheritance.sol | 4 - .../057_legal_override_direct.sol | 3 - .../058_legal_override_indirect.sol | 4 - .../059_illegal_override_visibility.sol | 5 - .../060_complex_inheritance.sol | 5 - ...061_missing_base_constructor_arguments.sol | 4 - ...62_base_constructor_arguments_override.sol | 4 - ...63_implicit_derived_to_base_conversion.sol | 7 - ...64_implicit_base_to_derived_conversion.sol | 6 - .../065_super_excludes_current_contract.sol | 11 - ...ion_clash_with_state_variable_accessor.sol | 9 - ...069_base_class_state_variable_accessor.sol | 9 - .../070_struct_accessor_one_array_only.sol | 6 - ...e_class_state_variable_internal_member.sol | 8 - ..._state_variable_member_of_wrong_class1.sol | 11 - ..._state_variable_member_of_wrong_class2.sol | 12 - .../074_fallback_function.sol | 4 - .../075_fallback_function_with_arguments.sol | 6 - .../076_fallback_function_in_library.sol | 5 - .../076_receive_function_in_library.sol | 6 - ...llback_function_with_return_parameters.sol | 5 - .../078_fallback_function_twice.sol | 7 - .../079_fallback_function_inheritance.sol | 7 - .../nameAndTypeResolution/080_event.sol | 5 - .../081_event_too_many_indexed.sol | 5 - .../082_anonymous_event_four_indexed.sol | 3 - .../083_anonymous_event_too_many_indexed.sol | 5 - .../084_events_with_same_name.sol | 4 - ...vents_with_same_name_unnamed_arguments.sol | 4 - ..._events_with_same_name_different_types.sol | 4 - .../087_double_event_declaration.sol | 6 - ...le_event_declaration_ignores_anonymous.sol | 6 - ...uble_event_declaration_ignores_indexed.sol | 6 - .../nameAndTypeResolution/090_event_call.sol | 5 - .../091_event_function_inheritance_clash.sol | 12 - .../092_function_event_inheritance_clash.sol | 12 - .../093_function_event_in_contract_clash.sol | 8 - .../094_event_inheritance.sol | 7 - .../095_multiple_events_argument_clash.sol | 4 - ..._access_to_default_function_visibility.sol | 7 - .../097_access_to_internal_function.sol | 8 - ...s_to_default_state_variable_visibility.sol | 8 - .../099_access_to_internal_state_variable.sol | 8 - .../100_error_count_in_named_args.sol | 11 - .../101_empty_in_named_args.sol | 11 - ...uplicate_parameter_names_in_named_args.sol | 11 - ..._invalid_parameter_names_in_named_args.sol | 11 - .../104_empty_name_input_parameter.sol | 4 - .../105_constant_input_parameter.sol | 7 - .../106_empty_name_return_parameter.sol | 4 - ...ty_name_input_parameter_with_named_one.sol | 7 - ...y_name_return_parameter_with_named_one.sol | 7 - .../110_no_overflow_with_large_literal.sol | 7 - .../111_overflow_caused_by_ether_units.sol | 8 - .../112_exp_operator_exponent_too_big.sol | 5 - .../113_exp_warn_literal_base_1.sol | 8 - .../114_exp_warn_literal_base_2.sol | 6 - .../115_exp_warn_literal_base_3.sol | 5 - .../116_shift_warn_literal_base_1.sol | 8 - .../117_shift_warn_literal_base_2.sol | 6 - .../118_shift_warn_literal_base_3.sol | 5 - .../119_shift_warn_literal_base_4.sol | 6 - .../124_enum_member_access.sol | 8 - ...5_enum_member_access_accross_contracts.sol | 10 - .../126_enum_invalid_member_access.sol | 9 - .../127_enum_invalid_direct_member_access.sol | 9 - .../128_enum_explicit_conversion_is_okay.sol | 10 - ...nt_to_enum_explicit_conversion_is_okay.sol | 10 - ...um_implicit_conversion_is_not_okay_256.sol | 9 - ...num_implicit_conversion_is_not_okay_64.sol | 9 - ...32_enum_to_enum_conversion_is_not_okay.sol | 9 - .../133_enum_duplicate_values.sol | 5 - ...resolution_under_current_contract_name.sol | 12 - .../135_private_visibility.sol | 8 - ...te_visibility_via_explicit_base_access.sol | 8 - .../137_external_visibility.sol | 6 - .../138_similar_name_suggestions_expected.sol | 6 - .../139_no_name_suggestion.sol | 5 - .../140_multiple_similar_suggestions.sol | 11 - .../141_multiple_scopes_suggestions.sol | 9 - .../142_inheritence_suggestions.sol | 8 - ...s_identifier_suggestions_with_submatch.sol | 8 - ...144_no_spurious_identifier_suggestions.sol | 8 - .../145_external_base_visibility.sol | 8 - .../146_external_argument_assign.sol | 4 - .../147_external_argument_increment.sol | 4 - .../148_external_argument_delete.sol | 5 - ..._override_function_with_bytearray_type.sol | 8 - .../150_array_with_nonconstant_length.sol | 5 - .../151_array_with_negative_length.sol | 5 - .../152_array_copy_with_different_types1.sol | 7 - .../153_array_copy_with_different_types2.sol | 7 - ...th_different_types_conversion_possible.sol | 5 - ...py_with_different_types_static_dynamic.sol | 5 - ...py_with_different_types_dynamic_static.sol | 7 - .../157_array_of_undeclared_type.sol | 5 - ...initialization_with_incorrect_type_int.sol | 5 - ...tialization_with_incorrect_type_string.sol | 5 - .../160_test_byte_is_alias_of_byte1.sol | 7 - .../164_assigning_value_to_const_variable.sol | 6 - .../165_assigning_state_to_const_variable.sol | 5 - ...nt_string_literal_disallows_assignment.sol | 10 - ...ment_to_const_var_involving_conversion.sol | 3 - ...ment_to_const_var_involving_expression.sol | 3 - ...signment_to_const_var_involving_keccak.sol | 3 - .../171_assignment_to_const_array_vars.sol | 5 - .../172_assignment_to_const_string_bytes.sol | 5 - .../173_constant_struct.sol | 6 - .../174_address_is_constant.sol | 3 - .../175_uninitialized_const_variable.sol | 5 - ...176_overloaded_function_cannot_resolve.sol | 7 - .../177_ambiguous_overloaded_function.sol | 8 - ...8_assignment_of_nonoverloaded_function.sol | 6 - .../179_assignment_of_overloaded_function.sol | 7 - .../180_external_types_clash.sol | 9 - .../181_override_changes_return_types.sol | 8 - .../182_equal_overload.sol | 6 - .../185_invalid_utf8_implicit.sol | 5 - .../186_invalid_utf8_explicit.sol | 5 - .../187_large_utf8_codepoint.sol | 3 - .../188_string_index.sol | 6 - .../189_string_length.sol | 6 - ...gative_integers_to_signed_out_of_bound.sol | 5 - .../191_negative_integers_to_signed_min.sol | 3 - ...sitive_integers_to_signed_out_of_bound.sol | 5 - ...ve_integers_to_signed_out_of_bound_max.sol | 3 - .../194_negative_integers_to_unsigned.sol | 5 - ...tive_integers_to_unsigned_out_of_bound.sol | 5 - .../196_integer_boolean_or.sol | 3 - .../197_integer_boolean_and.sol | 3 - .../198_integer_boolean_not.sol | 3 - .../199_integer_unsigned_exp_signed.sol | 3 - .../200_integer_signed_exp_unsigned.sol | 5 - .../201_integer_signed_exp_signed.sol | 8 - .../202_bytes_reference_compare_operators.sol | 3 - ...203_struct_reference_compare_operators.sol | 10 - ...204_overwrite_memory_location_external.sol | 5 - ...05_overwrite_storage_location_external.sol | 5 - .../206_storage_location_local_variables.sol | 9 - .../207_no_mappings_in_memory_array.sol | 7 - ...signment_mem_to_local_storage_variable.sol | 9 - ...age_assign_to_different_local_variable.sol | 12 - .../210_uninitialized_mapping_variable.sol | 8 - ...1_uninitialized_mapping_array_variable.sol | 8 - .../213_no_delete_on_storage_pointers.sol | 9 - ...signment_mem_storage_variable_directly.sol | 6 - .../215_function_argument_mem_to_storage.sol | 9 - .../216_function_argument_storage_to_mem.sol | 8 - ...mem_array_assignment_changes_base_type.sol | 10 - .../219_memory_arrays_not_resizeable.sol | 8 - .../220_struct_constructor.sol | 9 - .../221_struct_constructor_nested.sol | 11 - .../222_struct_named_constructor.sol | 9 - .../223_literal_strings.sol | 9 - .../224_string_bytes_conversion.sol | 11 - .../225_inheriting_from_library.sol | 4 - .../226_inheriting_library.sol | 4 - .../227_library_having_variables.sol | 3 - .../228_valid_library.sol | 1 - .../229_call_to_library_function.sol | 11 - ..._creating_contract_within_the_contract.sol | 5 - .../231_array_out_of_bound_access.sol | 9 - .../232_literal_string_to_storage_pointer.sol | 5 - .../233_non_initialized_references.sol | 11 - ...abi_encode_with_large_integer_constant.sol | 5 - .../236_cyclic_binary_dependency.sol | 5 - ...clic_binary_dependency_via_inheritance.sol | 5 - .../nameAndTypeResolution/244_tuples.sol | 10 - .../245_tuples_empty_components.sol | 7 - .../250_member_access_parser_ambiguity.sol | 16 - .../251_using_for_library.sol | 4 - .../252_using_for_not_library.sol | 6 - .../253_using_for_function_exists.sol | 10 - .../254_using_for_function_on_int.sol | 9 - .../255_using_for_function_on_struct.sol | 8 - .../256_using_for_overload.sol | 13 - .../257_using_for_by_name.sol | 8 - .../258_using_for_mismatch.sol | 9 - .../259_using_for_not_used.sol | 11 - .../260_library_memory_struct.sol | 6 - .../261_using_for_arbitrary_mismatch.sol | 10 - .../262_bound_function_in_var.sol | 13 - .../263_create_memory_arrays.sol | 14 - .../264_mapping_in_memory_array.sol | 7 - .../265_new_for_non_array.sol | 7 - .../268_function_overload_array_type.sol | 5 - .../275_inline_struct_declaration_arrays.sol | 12 - .../279_break_not_in_loop.sol | 8 - .../280_continue_not_in_loop.sol | 8 - .../281_continue_not_in_loop_2.sol | 10 - ...erent_types_for_conditional_expression.sol | 7 - ...nditional_expression_not_supported_yet.sol | 10 - ...ional_expression_with_different_struct.sol | 15 - ...xpression_with_different_function_type.sol | 10 - ...itional_expression_with_different_enum.sol | 13 - ...onal_expression_with_different_mapping.sol | 10 - .../288_conditional_with_all_types.sol | 89 - .../289_uint7_and_uintM_as_identifier.sol | 12 - .../290_varM_disqualified_as_keyword_1.sol | 7 - .../290_varM_disqualified_as_keyword_2.sol | 7 - .../290_varM_disqualified_as_keyword_3.sol | 7 - .../291_modifier_is_not_a_valid_typename.sol | 9 - ...r_is_not_a_valid_typename_is_not_fatal.sol | 10 - .../293_function_is_not_a_valid_typename.sol | 10 - .../294_long_uint_variable_fails.sol | 7 - .../295_bytes10abc_is_identifier.sol | 8 - .../296_int10abc_is_identifier.sol | 9 - ...97_library_functions_do_not_have_value.sol | 8 - .../298_invalid_fixed_types_0x7_mxn.sol | 5 - ...id_fixed_types_long_invalid_identifier.sol | 5 - .../300_invalid_fixed_types_7x8_mxn.sol | 5 - .../301_library_instances_cannot_be_used.sol | 10 - .../302_invalid_fixed_type_long.sol | 7 - .../303_fixed_type_int_conversion.sol | 12 - ...304_fixed_type_rational_int_conversion.sol | 10 - ...ixed_type_rational_fraction_conversion.sol | 10 - ...lid_int_implicit_conversion_from_fixed.sol | 9 - .../307_rational_unary_minus_operation.sol | 9 - .../308_rational_unary_plus_operation.sol | 9 - .../312_leading_zero_rationals_convert.sol | 11 - .../313_fixed_type_size_capabilities.sol | 14 - .../314_fixed_type_zero_handling.sol | 9 - ..._type_invalid_implicit_conversion_size.sol | 8 - ..._invalid_implicit_conversion_lost_data.sol | 7 - ..._fixed_type_valid_explicit_conversions.sol | 10 - ...nvalid_array_declaration_with_rational.sol | 7 - ...ray_declaration_with_signed_fixed_type.sol | 7 - ...y_declaration_with_unsigned_fixed_type.sol | 7 - ..._rational_to_bytes_implicit_conversion.sol | 7 - ...322_fixed_to_bytes_implicit_conversion.sol | 8 - .../323_mapping_with_fixed_literal.sol | 8 - .../324_fixed_points_inside_structs.sol | 9 - .../327_rational_index_access.sol | 8 - ...8_rational_to_fixed_literal_expression.sol | 16 - .../329_rational_as_exponent_value_signed.sol | 7 - ...30_rational_as_exponent_value_unsigned.sol | 7 - .../331_rational_as_exponent_half.sol | 7 - ...rational_as_exponent_value_neg_quarter.sol | 7 - .../333_fixed_point_casting_exponents_15.sol | 7 - .../334_fixed_point_casting_exponents_neg.sol | 7 - .../338_rational_bitnot_unary_operation.sol | 7 - .../339_rational_bitor_binary_operation.sol | 7 - .../340_rational_bitxor_binary_operation.sol | 7 - .../341_rational_bitand_binary_operation.sol | 7 - .../342_missing_bool_conversion.sol | 7 - .../343_integer_and_fixed_interaction.sol | 9 - ...ne_divided_by_three_integer_conversion.sol | 7 - .../345_unused_return_value.sol | 7 - .../346_unused_return_value_send.sol | 7 - .../347_unused_return_value_call.sol | 7 - .../348_unused_return_value_call_value.sol | 7 - .../350_unused_return_value_delegatecall.sol | 7 - .../351_callcode_deprecated.sol | 7 - ...53_callcode_not_deprecated_as_function.sol | 5 - .../354_payable_in_library.sol | 5 - .../355_payable_external.sol | 3 - .../356_payable_internal.sol | 5 - .../357_payable_private.sol | 5 - .../358_illegal_override_payable.sol | 5 - ...59_illegal_override_payable_nonpayable.sol | 5 - .../360_function_variable_mixin.sol | 12 - .../361_calling_payable.sol | 6 - .../362_calling_nonpayable.sol | 6 - .../363_non_payable_constructor.sol | 11 - .../366_invalid_array_as_statement.sol | 6 - ...7_using_directive_for_missing_selftype.sol | 14 - ...68_shift_constant_left_negative_rvalue.sol | 5 - ...9_shift_constant_right_negative_rvalue.sol | 5 - ...0_shift_constant_left_excessive_rvalue.sol | 5 - ..._shift_constant_right_excessive_rvalue.sol | 5 - .../372_shift_constant_right_fractional.sol | 5 - .../396_invalid_mobile_type.sol | 10 - ...g_value_in_non_payable_public_function.sol | 7 - ...not_warn_msg_value_in_payable_function.sol | 5 - ...ot_warn_msg_value_in_internal_function.sol | 5 - ...400_does_not_warn_msg_value_in_library.sol | 5 - ..._following_non_payable_public_function.sol | 4 - .../402_assignment_to_constant.sol | 6 - .../403_return_structs.sol | 8 - .../404_read_returned_struct.sol | 11 - .../405_address_checksum_type_deduction.sol | 6 - .../406_invalid_address_checksum.sol | 8 - .../407_invalid_address_no_checksum.sol | 8 - .../408_invalid_address_length_short.sol | 8 - .../409_invalid_address_length_long.sol | 8 - ...t_convertible_to_address_as_assignment.sol | 6 - ...convertible_to_address_as_return_value.sol | 8 - .../412_early_exit_on_fatal_errors.sol | 12 - .../413_address_methods.sol | 12 - .../nameAndTypeResolution/414_interface.sol | 2 - .../415_interface_functions.sol | 5 - .../416_interface_function_bodies.sol | 6 - .../417_interface_events.sol | 3 - .../418_interface_inheritance.sol | 4 - .../419_interface_structs.sol | 6 - .../420_interface_variables.sol | 5 - .../421_interface_function_parameters.sol | 4 - .../422_interface_enums.sol | 4 - .../423_using_interface.sol | 8 - .../424_using_interface_complex.sol | 11 - ...25_interface_implement_public_contract.sol | 8 - .../426_throw_is_deprecated.sol | 7 - .../nameAndTypeResolution/428_bare_revert.sol | 8 - .../429_revert_with_reason.sol | 8 - .../430_bare_selfdestruct.sol | 5 - .../nameAndTypeResolution/431_bare_assert.sol | 5 - .../432_bare_require.sol | 6 - .../433_pure_statement_in_for_loop.sol | 8 - ...e_statement_check_for_regular_for_loop.sol | 6 - .../438_unused_unnamed_function_parameter.sol | 4 - .../441_unused_unnamed_return_parameter.sol | 4 - .../442_named_return_parameter.sol | 5 - ..._return_parameter_with_explicit_return.sol | 5 - ..._return_parameter_with_explicit_return.sol | 5 - ..._no_unused_warning_interface_arguments.sol | 3 - ...6_no_unused_warning_abstract_arguments.sol | 4 - .../447_no_unused_warnings.sol | 6 - ...459_function_overload_is_not_shadowing.sol | 4 - ...460_function_override_is_not_shadowing.sol | 4 - ...parameter_cannot_shadow_state_variable.sol | 4 - .../462_callable_crash.sol | 9 - ...es_not_error_transfer_payable_fallback.sol | 15 - ...es_not_error_transfer_regular_function.sol | 11 - .../470_specified_storage_no_warn.sol | 8 - .../471_unspecified_storage_fail.sol | 13 - ...ocation_non_array_or_struct_disallowed.sol | 5 - ...rray_or_struct_disallowed_is_not_fatal.sol | 7 - .../475_implicit_conversion_disallowed.sol | 8 - ...too_large_arrays_for_calldata_external.sol | 6 - ...too_large_arrays_for_calldata_internal.sol | 6 - ...8_too_large_arrays_for_calldata_public.sol | 6 - ...it_literal_to_memory_string_assignment.sol | 6 - ...t_literal_to_storage_string_assignment.sol | 7 - ...teral_to_unspecified_string_assignment.sol | 7 - ...explicit_literal_to_unspecified_string.sol | 7 - .../483_modifiers_access_storage_pointer.sol | 7 - .../484_function_types_selector_1.sol | 7 - .../485_function_types_selector_2.sol | 9 - .../486_function_types_selector_3.sol | 8 - .../487_function_types_selector_4.sol | 5 - .../488_function_types_selector_5.sol | 8 - .../489_function_types_selector_6.sol | 8 - .../490_function_types_selector_7.sol | 9 - .../491_using_this_in_constructor.sol | 9 - .../492_do_not_crash_on_not_lvalue.sol | 11 - .../493_builtin_keccak256_reject_gas.sol | 7 - .../494_builtin_sha256_reject_gas.sol | 7 - .../495_builtin_ripemd160_reject_gas.sol | 7 - .../496_builtin_ecrecover_reject_gas.sol | 7 - .../nameAndTypeResolution/497_gasleft.sol | 3 - .../498_msg_gas_deprecated.sol | 5 - .../500_gasleft_shadowing_1.sol | 6 - .../501_gasleft_shadowing_2.sol | 6 - .../502_builtin_keccak256_reject_value.sol | 7 - .../503_builtin_sha256_reject_value.sol | 7 - .../504_builtin_ripemd160_reject_value.sol | 7 - .../505_builtin_ecrecover_reject_value.sol | 7 - .../506_large_storage_array_fine.sol | 3 - .../507_large_storage_array_simple.sol | 5 - .../508_large_storage_arrays_combined.sol | 5 - .../509_large_storage_arrays_struct.sol | 6 - .../510_large_storage_array_mapping.sol | 5 - ...function_without_implementation_public.sol | 7 - ...nction_without_implementation_internal.sol | 5 - ...unction_without_implementation_private.sol | 5 - .../514_using_for_with_non_library.sol | 10 - .../515_experimental_pragma_empty.sol | 3 - ...rimental_pragma_unknown_number_literal.sol | 3 - ...rimental_pragma_unknown_string_literal.sol | 3 - ...l_pragma_unknown_quoted_string_literal.sol | 3 - ...xperimental_pragma_empy_string_literal.sol | 3 - ...experimental_pragma_multiple_same_line.sol | 3 - .../521_experimental_pragma_test_warning.sol | 3 - .../522_experimental_pragma_duplicate.sol | 5 - .../523_reject_interface_creation.sol | 8 - .../524_accept_library_creation.sol | 6 - .../525_reject_interface_constructors.sol | 4 - .../526_fallback_marked_external.sol | 3 - .../527_fallback_marked_internal.sol | 5 - .../528_fallback_marked_private.sol | 5 - .../529_fallback_marked_public.sol | 5 - ...ple_invalid_literal_too_large_for_uint.sol | 8 - ...e_invalid_literal_too_large_unassigned.sol | 8 - ...valid_literal_too_large_for_uint_multi.sol | 8 - ...33_tuple_invalid_literal_too_large_exp.sol | 7 - ...e_invalid_literal_too_large_expression.sol | 7 - .../535_address_overload_resolution.sol | 20 - ...ength_invalid_expression_negative_bool.sol | 5 - ...th_invalid_expression_int_divides_bool.sol | 5 - ...th_invalid_expression_bool_divides_int.sol | 5 - ..._invalid_expression_scientific_literal.sol | 5 - ...th_invalid_expression_division_by_zero.sol | 5 - ...ut_address_members_on_contract_balance.sol | 7 - ...t_address_members_on_contract_transfer.sol | 7 - ...about_address_members_on_contract_send.sol | 7 - ...about_address_members_on_contract_call.sol | 7 - ...t_address_members_on_contract_callcode.sol | 7 - ...dress_members_on_contract_delegatecall.sol | 7 - ...s_members_on_non_this_contract_balance.sol | 8 - ..._members_on_non_this_contract_transfer.sol | 8 - ...ress_members_on_non_this_contract_send.sol | 8 - ...ress_members_on_non_this_contract_call.sol | 8 - ..._members_on_non_this_contract_callcode.sol | 8 - ...bers_on_non_this_contract_delegatecall.sol | 8 - ...members_that_look_like_address_members.sol | 7 - .../560_event_emit_simple.sol | 6 - .../561_event_emit_complex.sol | 7 - .../562_event_emit_foreign_class.sol | 7 - .../563_event_without_emit_deprecated.sol | 8 - .../nameAndTypeResolution/568_blockhash.sol | 3 - .../569_block_blockhash_deprecated.sol | 7 - .../570_function_type_undeclared_type.sol | 5 - ...function_type_undeclared_type_external.sol | 5 - ...tion_type_undeclared_type_multi_nested.sol | 5 - ...ilar_name_longer_than_80_not_suggested.sol | 7 - ...similar_name_shorter_than_80_suggested.sol | 7 - ...member_getter_call_without_parentheses.sol | 19 - ...member_getter_call_without_parentheses.sol | 17 - ...l_without_parentheses_missing_function.sol | 15 - ...member_getter_call_without_parentheses.sol | 17 - ...l_without_parentheses_private_function.sol | 17 - ...ve_name_suggestion_one_and_two_letters.sol | 14 - ..._improve_name_suggestion_three_letters.sol | 12 - ...2_improve_name_suggestion_four_letters.sol | 17 - ...e_packed_with_rational_number_constant.sol | 5 - ..._decode_with_tuple_of_other_than_types.sol | 5 - .../585_abi_decode_with_unsupported_types.sol | 8 - .../587_event_param_type_outside_storage.sol | 7 - .../compoundAssignment/incomp_types.sol | 7 - .../compoundAssignment/tuple.sol | 7 - .../tuple_invalid_inline_array_type.sol | 8 - .../constant_mapping.sol | 8 - .../invalidArgs/creating_memory_array.sol | 7 - .../invalidArgs/creating_struct.sol | 9 - .../creating_struct_members_skipped.sol | 9 - .../invalidArgs/explicit_conversions.sol | 9 - .../invalidTypes/conditional_expression.sol | 16 - .../invalidTypes/constructor_call.sol | 12 - .../no_effect_statements.sol | 16 - .../shadowsBuiltin/events.sol | 5 - .../shadowsBuiltin/functions.sol | 5 - .../shadowsBuiltin/global_scope.sol | 4 - .../shadowsBuiltin/ignores_constructor.sol | 3 - .../shadowsBuiltin/ignores_struct.sol | 5 - .../shadowsBuiltin/parameters.sol | 7 - .../shadowsBuiltin/return_parameters.sol | 7 - .../shadowsBuiltin/storage_variables.sol | 5 - .../shadowsBuiltin/this_super.sol | 11 - .../shadowsBuiltin/variables.sol | 8 - .../typeChecking/function_call.sol | 5 - .../typeChecking/library_instances.sol | 14 - .../typeChecking/return.sol | 5 - .../return_tuple_not_convertible.sol | 5 - .../typeChecking/return_wrong_number.sol | 5 - .../typeChecking/return_wrong_type.sol | 5 - .../warnUnused/function_parameter.sol | 5 - .../warnUnused/local.sol | 7 - .../warnUnused/local_assignment.sol | 7 - .../warnUnused/return_parameter.sol | 5 - .../natspec/docstring_empty_description.sol | 6 - .../natspec/docstring_empty_tag.sol | 6 - .../natspec/docstring_parameter.sol | 11 - .../dosctring_named_return_parameter.sol | 5 - .../natspec/invalid/docstring_parameter.sol | 11 - .../dosctring_named_return_param_mismatch.sol | 7 - .../dosctring_return_size_mismatch.sol | 7 - .../parsing/address_constant_payable.sol | 5 - ...address_function_arguments_and_returns.sol | 4 - .../syntaxTests/parsing/address_in_struct.sol | 6 - .../address_invalid_state_mutability.sol | 26 - .../parsing/address_nonpayable.sol | 7 - .../syntaxTests/parsing/address_payable.sol | 7 - .../parsing/address_payable_constant.sol | 3 - .../parsing/address_payable_conversion.sol | 7 - .../parsing/address_payable_function_type.sol | 6 - .../parsing/address_payable_library.sol | 5 - .../parsing/address_payable_local.sol | 11 - .../address_payable_state_variable.sol | 8 - .../parsing/address_payable_struct.sol | 8 - .../address_payable_type_expression.sol | 7 - .../parsing/address_public_payable_error.sol | 5 - .../parsing/array_range_and_ternary.sol | 8 - .../parsing/array_range_conversion.sol | 14 - .../parsing/array_range_nested.sol | 11 - .../parsing/array_range_no_start.sol | 6 - .../syntaxTests/parsing/array_type_range.sol | 14 - .../syntaxTests/parsing/arrays_in_events.sol | 3 - .../parsing/arrays_in_expressions.sol | 6 - .../syntaxTests/parsing/arrays_in_storage.sol | 6 - .../parsing/assembly_evmasm_type.sol | 5 - .../parsing/assembly_invalid_type.sol | 7 - .../syntaxTests/parsing/calling_function.sol | 7 - .../parsing/comment_end_with_double_star.sol | 5 - .../parsing/conditional_multiple.sol | 8 - .../conditional_true_false_literal.sol | 10 - .../parsing/conditional_with_assignment.sol | 8 - .../parsing/conditional_with_constants.sol | 10 - .../parsing/conditional_with_variables.sol | 12 - .../parsing/constant_is_keyword.sol | 5 - .../parsing/constant_state_modifier.sol | 8 - .../parsing/constructor_allowed_this.sol | 28 - .../syntaxTests/parsing/constructor_super.sol | 10 - .../declaring_fixed_and_ufixed_variables.sol | 14 - .../declaring_fixed_literal_variables.sol | 5 - ...ary_non_address_payable_state_variable.sol | 29 - ...lementary_non_address_payable_argument.sol | 29 - .../elementary_non_address_payable_local.sol | 31 - .../elementary_non_address_payable_return.sol | 29 - .../syntaxTests/parsing/else_if_statement.sol | 7 - .../parsing/emit_without_event.sol | 8 - .../syntaxTests/parsing/empty_comment.sol | 3 - .../syntaxTests/parsing/empty_enum.sol | 5 - .../syntaxTests/parsing/empty_function.sol | 5 - .../parsing/enum_from_interface.sol | 9 - .../enum_from_interface_in_library.sol | 12 - .../syntaxTests/parsing/enum_from_library.sol | 9 - .../parsing/enum_inheritance_contract.sol | 9 - .../parsing/enum_inheritance_interface.sol | 9 - .../parsing/enum_valid_declaration.sol | 7 - .../libsolidity/syntaxTests/parsing/event.sol | 3 - .../syntaxTests/parsing/event_arguments.sol | 3 - .../parsing/event_arguments_indexed.sol | 3 - .../parsing/event_with_no_argument_list.sol | 5 - .../syntaxTests/parsing/exp_expression.sol | 8 - .../syntaxTests/parsing/external_function.sol | 4 - .../syntaxTests/parsing/external_variable.sol | 5 - .../syntaxTests/parsing/fallback_function.sol | 4 - .../fixed_literal_with_double_radix.sol | 5 - .../parsing/for_loop_simple_initexpr.sol | 14 - .../parsing/for_loop_simple_noexpr.sol | 13 - .../parsing/for_loop_single_stmt_body.sol | 10 - .../parsing/for_loop_vardef_initexpr.sol | 13 - .../parsing/from_is_not_keyword.sol | 3 - .../syntaxTests/parsing/function_no_body.sol | 4 - .../parsing/function_normal_comments.sol | 6 - .../parsing/function_type_as_parameter.sol | 5 - .../function_type_as_storage_variable.sol | 3 - ...pe_as_storage_variable_with_assignment.sol | 5 - ...ype_as_storage_variable_with_modifiers.sol | 5 - .../parsing/function_type_in_expression.sol | 9 - .../parsing/function_type_in_struct.sol | 10 - .../parsing/function_type_state_variable.sol | 4 - .../syntaxTests/parsing/if_statement.sol | 8 - .../syntaxTests/parsing/import_complex.sol | 3 - .../parsing/import_complex_invalid_from.sol | 3 - .../parsing/import_complex_without_from.sol | 3 - .../syntaxTests/parsing/import_empty.sol | 3 - .../parsing/import_invalid_token.sol | 3 - .../syntaxTests/parsing/import_simple.sol | 3 - .../parsing/inline_array_declaration.sol | 8 - .../inline_array_empty_cells_check_lvalue.sol | 9 - ...array_empty_cells_check_without_lvalue.sol | 8 - .../syntaxTests/parsing/interface_basic.sol | 4 - ..._fixed_conversion_leading_zeroes_check.sol | 7 - ...lexer_numbers_with_underscores_decimal.sol | 13 - ..._numbers_with_underscores_decimal_fail.sol | 13 - .../lexer_numbers_with_underscores_fixed.sol | 10 - ...er_numbers_with_underscores_fixed_fail.sol | 17 - .../lexer_numbers_with_underscores_hex.sol | 13 - ...exer_numbers_with_underscores_hex_fail.sol | 7 - .../syntaxTests/parsing/library_simple.sol | 4 - ..._constants_with_ether_subdenominations.sol | 15 - ..._ether_subdenominations_in_expressions.sol | 7 - .../parsing/local_const_variable.sol | 9 - .../location_specifiers_for_locals.sol | 9 - .../location_specifiers_for_locals_multi.sol | 12 - .../location_specifiers_for_params.sol | 7 - .../location_specifiers_for_params_multi.sol | 6 - ...ocation_specifiers_for_state_variables.sol | 5 - ...n_specifiers_for_state_variables_multi.sol | 5 - .../parsing/location_specifiers_with_var.sol | 5 - .../parsing/malformed_enum_declaration.sol | 5 - .../syntaxTests/parsing/mapping.sol | 3 - .../mapping_and_array_of_functions.sol | 6 - .../parsing/mapping_from_address_payable.sol | 5 - .../syntaxTests/parsing/mapping_in_struct.sol | 7 - .../parsing/mapping_nonelementary_key_1.sol | 5 - .../parsing/mapping_nonelementary_key_2.sol | 8 - .../parsing/mapping_nonelementary_key_3.sol | 8 - .../parsing/mapping_nonelementary_key_4.sol | 5 - .../parsing/mapping_to_mapping_in_struct.sol | 6 - .../missing_argument_in_named_args.sol | 6 - .../missing_parameter_name_in_named_args.sol | 6 - .../missing_variable_name_in_declaration.sol | 5 - .../syntaxTests/parsing/modifier.sol | 3 - .../parsing/modifier_arguments.sol | 3 - .../parsing/modifier_invocation.sol | 6 - .../parsing/modifier_without_semicolon.sol | 5 - .../syntaxTests/parsing/multi_arrays.sol | 3 - .../parsing/multi_variable_declarations.sol | 13 - .../multiple_event_arg_trailing_comma.sol | 6 - ...multiple_function_param_trailing_comma.sol | 5 - ...ltiple_functions_natspec_documentation.sol | 12 - .../multiple_modifier_arg_trailing_comma.sol | 6 - .../multiple_return_param_trailing_comma.sol | 5 - .../multiple_statemutability_specifiers.sol | 33 - .../parsing/new_address_payable.sol | 5 - .../parsing/new_invalid_type_name.sol | 7 - .../parsing/no_function_params.sol | 5 - .../parsing/overloaded_functions.sol | 7 - .../syntaxTests/parsing/payable_accessor.sol | 5 - .../parsing/payable_without_arguments.sol | 7 - .../placeholder_in_function_context.sol | 8 - .../syntaxTests/parsing/pragma_illegal.sol | 4 - .../syntaxTests/parsing/return_var.sol | 25 - .../parsing/scientific_notation.sol | 7 - .../single_event_arg_trailing_comma.sol | 6 - .../parsing/single_function_param.sol | 5 - .../single_function_param_trailing_comma.sol | 5 - .../single_modifier_arg_trailing_comma.sol | 6 - .../single_return_param_trailing_comma.sol | 5 - .../syntaxTests/parsing/smoke_test.sol | 4 - .../syntaxTests/parsing/struct_definition.sol | 7 - .../parsing/trailing_comma_in_named_args.sol | 6 - .../syntaxTests/parsing/trailing_dot1.sol | 7 - .../syntaxTests/parsing/trailing_dot2.sol | 7 - .../syntaxTests/parsing/trailing_dot3.sol | 4 - .../syntaxTests/parsing/tuples.sol | 11 - .../parsing/tuples_decl_without_rhs.sol | 7 - .../parsing/tuples_without_commas.sol | 7 - .../parsing/two_exact_functions.sol | 9 - .../parsing/unary_plus_expression.sol | 9 - .../syntaxTests/parsing/var_array.sol | 5 - .../parsing/var_in_function_arguments.sol | 25 - .../syntaxTests/parsing/var_storage_var.sol | 5 - .../variable_definition_in_mapping.sol | 7 - .../parsing/visibility_specifiers.sol | 11 - .../syntaxTests/parsing/while_loop.sol | 8 - .../syntaxTests/pragma/invalid_pragma.sol | 3 - .../syntaxTests/pragma/unknown_pragma.sol | 3 - .../syntaxTests/receiveEther/arguments.sol | 5 - .../receiveEther/default_visibility.sol | 8 - .../syntaxTests/receiveEther/old_syntax.sol | 5 - .../receiveEther/pure_modifier.sol | 6 - .../receiveEther/receive_as_function_name.sol | 5 - .../syntaxTests/receiveEther/return_value.sol | 6 - .../receiveEther/view_modifier.sol | 6 - .../single_return_mismatching_number.sol | 14 - ...single_return_mismatching_number_named.sol | 14 - .../single_return_mismatching_type.sol | 9 - .../tuple_return_mismatching_number.sol | 19 - .../tuple_return_mismatching_number_named.sol | 19 - .../returnExpressions/valid_returns.sol | 18 - .../scoping/double_function_declaration.sol | 6 - ...le_variable_declaration_disjoint_scope.sol | 9 - ..._declaration_disjoint_scope_activation.sol | 9 - ...le_declaration_same_and_disjoint_scope.sol | 10 - ...double_variable_declaration_same_scope.sol | 8 - .../function_state_variable_conflict.sol | 6 - .../syntaxTests/scoping/name_shadowing.sol | 6 - .../poly_variable_declaration_same_scope.sol | 16 - .../syntaxTests/scoping/scoping.sol | 10 - .../scoping/scoping_activation.sol | 8 - .../scoping/scoping_activation_old.sol | 8 - .../syntaxTests/scoping/scoping_for.sol | 7 - .../syntaxTests/scoping/scoping_for2.sol | 6 - .../syntaxTests/scoping/scoping_for3.sol | 10 - .../scoping/scoping_for_decl_in_body.sol | 9 - .../syntaxTests/scoping/scoping_old.sol | 8 - .../syntaxTests/scoping/scoping_self_use.sol | 7 - .../state_variable_function_conflict.sol | 6 - ...ariable_function_conflict_former_crash.sol | 14 - .../syntaxTests/signed_rational_modulus.sol | 10 - .../libsolidity/syntaxTests/smoke_test.sol | 6 - .../abi_encodePacked_structs_v2.sol | 15 - .../specialFunctions/abi_encode_structs.sol | 17 - .../abi_encode_structs_abiv2.sol | 22 - .../abi_functions_member_access.sol | 15 - .../abidecode/abi_decode_calldata.sol | 8 - .../abidecode/abi_decode_empty.sol | 7 - .../abi_decode_invalid_arg_count.sol | 12 - .../abidecode/abi_decode_invalid_arg_type.sol | 8 - .../abidecode/abi_decode_memory.sol | 7 - .../abidecode/abi_decode_memory_v2.sol | 9 - .../abidecode/abi_decode_nontuple.sol | 11 - .../abidecode/abi_decode_simple.sol | 5 - .../abidecode/abi_decode_single_return.sol | 5 - .../abidecode/abi_decode_singletontuple.sol | 6 - .../abidecode/abi_decode_storage.sol | 8 - .../encodePacked_array_of_structs.sol | 9 - .../encodePacked_dynamic_string_array_v2.sol | 13 - .../encode_array_of_struct.sol | 9 - .../specialFunctions/single_non_bytes_arg.sol | 12 - ...nspecified_encoding_internal_functions.sol | 11 - ...ith_unspecified_encoding_special_types.sol | 13 - ...ypes_with_unspecified_encoding_structs.sol | 13 - .../types_with_unspecified_encoding_types.sol | 17 - .../types_without_encoding_problems.sol | 9 - .../syntaxTests/string/string_escapes.sol | 7 - .../string_multipart_hex_valid_parts.sol | 8 - ...ring_multipart_newline_with_hex_prefix.sol | 9 - ...g_multipart_newline_without_hex_prefix.sol | 10 - .../string/string_multipart_only_hex.sol | 8 - .../string/string_multipart_only_regular.sol | 8 - .../string/string_multipart_single_line.sol | 7 - .../syntaxTests/string/string_new_line.sol | 9 - .../string/string_terminated_by_backslash.sol | 8 - .../string/string_unterminated.sol | 7 - .../string_unterminated_no_new_line.sol | 4 - .../structs/address_member_access.sol | 9 - .../structs/address_member_declaration.sol | 5 - .../syntaxTests/structs/array_calldata.sol | 7 - .../syntaxTests/structs/calldata.sol | 6 - .../structs/calldata_array_assign.sol | 9 - .../syntaxTests/structs/calldata_assign.sol | 7 - .../syntaxTests/structs/calldata_dynamic.sol | 6 - .../structs/calldata_struct_function_type.sol | 8 - .../contract_global_struct_name_clash.sol | 4 - .../syntaxTests/structs/global_struct.sol | 7 - .../global_struct_contract_name_clash.sol | 4 - .../structs/global_struct_shadowing.sol | 10 - .../structs/global_structs_name_clash.sol | 4 - .../structs/memory_to_calldata.sol | 11 - .../recursion/multi_struct_composition.sol | 14 - .../structs/recursion/parallel_structs.sol | 14 - ..._struct_as_contract_function_parameter.sol | 10 - ...e_struct_as_library_function_parameter.sol | 9 - ...t_as_memory_library_function_parameter.sol | 13 - .../recursive_struct_forward_reference.sol | 10 - ...function_as_library_function_parameter.sol | 11 - .../recursion/return_recursive_structs.sol | 7 - .../recursion/return_recursive_structs2.sol | 7 - .../recursion/return_recursive_structs3.sol | 8 - .../static_array_of_recursive_structs.sol | 10 - .../struct_definition_directly_recursive.sol | 8 - ...ition_directly_recursive_dynamic_array.sol | 7 - ...inition_directly_recursive_fixed_array.sol | 8 - ...struct_definition_indirectly_recursive.sol | 12 - ...efinition_indirectly_recursive_complex.sol | 18 - ...on_indirectly_recursive_dynamic_array1.sol | 11 - ...on_indirectly_recursive_dynamic_array2.sol | 11 - ...on_indirectly_recursive_dynamic_array3.sol | 11 - ...directly_recursive_dynamic_multi_array.sol | 21 - ...tion_indirectly_recursive_fixed_array1.sol | 12 - ...tion_indirectly_recursive_fixed_array2.sol | 12 - ...tion_indirectly_recursive_fixed_array3.sol | 12 - ...indirectly_recursive_fixed_multi_array.sol | 12 - ...struct_definition_not_really_recursive.sol | 4 - ..._definition_not_really_recursive_array.sol | 4 - ...truct_definition_recursion_via_mapping.sol | 7 - .../syntaxTests/tight_packing_literals.sol | 8 - .../tight_packing_literals_fine.sol | 9 - .../tryCatch/almost_call_options.sol | 14 - .../syntaxTests/tryCatch/catch_error.sol | 11 - .../tryCatch/catch_error_named.sol | 11 - .../syntaxTests/tryCatch/catch_low_level.sol | 11 - .../syntaxTests/tryCatch/empty_catch.sol | 11 - .../syntaxTests/tryCatch/empty_returns.sol | 11 - .../tryCatch/error_with_wrong_type.sol | 12 - .../tryCatch/invalid_error_name.sol | 11 - .../syntaxTests/tryCatch/invalid_returns.sol | 13 - .../syntaxTests/tryCatch/library_call.sol | 40 - .../tryCatch/low_level_pre-byzantium.sol | 13 - .../tryCatch/low_level_with_wrong_type.sol | 12 - .../syntaxTests/tryCatch/no_catch.sol | 8 - .../syntaxTests/tryCatch/no_external_call.sol | 9 - .../syntaxTests/tryCatch/no_returns.sol | 9 - .../syntaxTests/tryCatch/returns.sol | 10 - .../syntaxTests/tryCatch/returns_memory.sol | 11 - .../tryCatch/returns_memory_anonymous.sol | 11 - .../syntaxTests/tryCatch/simple_catch.sol | 9 - .../tryCatch/structured_pre_byzantium.sol | 13 - .../tryCatch/two_catch_clauses.sol | 14 - .../tryCatch/two_error_catch_clauses.sol | 15 - .../tryCatch/two_low_level_catch_clauses.sol | 14 - .../tupleAssignments/double_storage_crash.sol | 11 - .../tupleAssignments/err_fill_assignment.sol | 11 - .../tupleAssignments/error_fill.sol | 11 - .../large_component_count.sol | 23 - .../tupleAssignments/nowarn_swap_memory.sol | 8 - .../nowarn_swap_storage_pointers.sol | 10 - .../warn_multiple_storage_storage_copies.sol | 9 - .../types/address/address_abi_decode.sol | 6 - .../address/address_binary_operators.sol | 15 - .../types/address/address_constant.sol | 7 - .../address/address_constant_assignment.sol | 11 - .../types/address/address_in_struct_fail.sol | 11 - .../types/address/address_in_struct_fine.sol | 20 - .../address/address_members_in_contract.sol | 6 - .../address_nonpayable_selfdestruct.sol | 7 - .../address_payable_external_overload.sol | 7 - ...s_payable_internal_overload_nonpayable.sol | 10 - ...ress_payable_internal_overload_payable.sol | 10 - ...ddress_payable_memory_array_conversion.sol | 11 - .../address_payable_public_overload.sol | 7 - .../address/address_payable_selfdestruct.sol | 5 - ...dress_payable_storage_array_conversion.sol | 11 - ..._payable_storage_array_conversion_fail.sol | 11 - .../types/address/address_to_contract.sol | 6 - .../address_to_contract_implicitly.sol | 7 - .../address_to_contract_payable_fallback.sol | 9 - .../address/address_to_contract_receive.sol | 8 - .../address/address_to_payable_address.sol | 10 - .../address_to_payable_address_double.sol | 7 - .../types/address/address_tuple_fail.sol | 8 - .../types/address/address_tuple_fine.sol | 6 - .../address/bytes_long_to_payable_address.sol | 8 - .../bytes_short_to_payable_address.sol | 8 - .../address/bytes_to_payable_address.sol | 5 - ...ontract_no_fallback_to_payable_address.sol | 8 - ...on_payable_fallback_to_payable_address.sol | 10 - ...ct_payable_fallback_to_payable_address.sol | 10 - ...fallback_to_payable_address_implicitly.sol | 11 - .../contract_receive_to_payable_address.sol | 9 - ..._receive_to_payable_address_implicitly.sol | 10 - .../types/address/contract_to_address.sol | 7 - .../contract_to_address_implicitly.sol | 8 - .../types/address/literal_to_address.sol | 9 - .../address/literal_to_payable_address.sol | 8 - ...e_address_to_contract_payable_fallback.sol | 11 - ...nonpayable_address_to_contract_receive.sol | 10 - .../address/payable_address_to_address.sol | 7 - .../types/address/uint_to_payable_address.sol | 5 - .../types/array_index_too_large.sol | 8 - .../syntaxTests/types/bool_ops.sol | 53 - .../libsolidity/syntaxTests/types/bytes0.sol | 5 - .../syntaxTests/types/bytes1_to_uint256.sol | 7 - .../syntaxTests/types/bytes256.sol | 5 - .../syntaxTests/types/bytes32_to_uint32.sol | 7 - .../libsolidity/syntaxTests/types/bytes33.sol | 5 - .../types/bytesXX_index_assign.sol | 8 - .../syntaxTests/types/bytes_to_contract.sol | 7 - .../types/bytes_to_uint_same_size.sol | 20 - .../libsolidity/syntaxTests/types/bytesm.sol | 36 - .../call_unimplemented_internal_function.sol | 6 - .../assign_function_via_base_name_to_var.sol | 14 - ...sign_function_via_contract_name_to_var.sol | 14 - .../members/base_contract.sol | 11 - .../members/base_contract_invalid.sol | 13 - .../call_function_via_contract_name.sol | 17 - .../members/call_unimplemented_base.sol | 10 - .../function_selector_via_contract_name.sol | 9 - .../function_selector_via_interface_name.sol | 9 - .../function_via_contract_name_internal.sol | 11 - .../function_via_contract_name_overloaded.sol | 12 - .../function_via_contract_name_private.sol | 11 - .../function_via_contract_name_public.sol | 9 - .../contractTypeType/members/modifier.sol | 10 - .../members/modifier_base.sol | 10 - .../contractTypeType/members/struct_enum.sol | 14 - .../syntaxTests/types/contract_to_base.sol | 9 - .../types/contract_to_base_base.sol | 10 - .../syntaxTests/types/contract_to_derived.sol | 9 - .../types/contract_to_unrelated_contract.sol | 9 - ...c_dependency_check_on_consts_exhausted.sol | 262 - ...cyclic_dependency_check_on_consts_good.sol | 135 - ...c_dependency_check_on_struct_exhausted.sol | 260 - ...cyclic_dependency_check_on_struct_good.sol | 134 - .../decimal_literal_to_bytesXX_explicit.sol | 23 - .../decimal_literal_to_bytesXX_implicit.sol | 23 - .../syntaxTests/types/empty_tuple_event.sol | 8 - .../types/empty_tuple_function.sol | 11 - .../syntaxTests/types/empty_tuple_lvalue.sol | 12 - .../types/empty_tuple_lvalue_array.sol | 10 - .../syntaxTests/types/encoding_fractional.sol | 7 - .../encoding_fractional_abiencoderv2.sol | 8 - .../types/encoding_packed_fractional.sol | 8 - ...ncoding_packed_fractional_abiencoderv2.sol | 9 - .../syntaxTests/types/function_call_fail.sol | 9 - .../syntaxTests/types/function_call_fail2.sol | 7 - .../function_parameter_return_types_fail.sol | 42 - ...unction_parameter_return_types_success.sol | 39 - .../function_state_mutability_fail.sol | 51 - .../function_state_mutability_success.sol | 46 - ...ral_to_bytesXX_different_size_explicit.sol | 31 - ...ral_to_bytesXX_different_size_implicit.sol | 31 - ..._literal_to_bytesXX_same_size_explicit.sol | 13 - ..._literal_to_bytesXX_same_size_implicit.sol | 13 - .../types/index_access_for_bytes.sol | 6 - .../types/library_function_selector.sol | 13 - .../library_function_selector_internal.sol | 10 - ...brary_function_selector_private_inside.sol | 8 - ...rary_function_selector_private_outside.sol | 10 - .../library_function_selector_view_pure.sol | 10 - .../types/library_internal_call.sol | 4 - .../syntaxTests/types/library_to_address.sol | 8 - .../types/library_to_address_payable.sol | 9 - .../types/mapping/access_index_omitted.sol | 8 - .../types/mapping/argument_external.sol | 6 - .../types/mapping/argument_internal.sol | 5 - .../types/mapping/argument_private.sol | 5 - .../types/mapping/argument_public.sol | 6 - .../types/mapping/array_argument_external.sol | 6 - .../types/mapping/array_argument_internal.sol | 5 - .../types/mapping/array_argument_private.sol | 5 - .../types/mapping/array_argument_public.sol | 6 - .../types/mapping/assignment_local.sol | 11 - .../mapping/assignment_state_variable.sol | 14 - .../types/mapping/assignment_struct.sol | 17 - .../types/mapping/contract_mapping.sol | 9 - .../mapping/contract_mapping_invalid.sol | 13 - .../types/mapping/enum_mapping.sol | 7 - .../types/mapping/enum_mapping_invalid.sol | 10 - .../function_type_argument_external.sol | 7 - .../function_type_argument_internal.sol | 4 - .../mapping/function_type_return_external.sol | 7 - .../mapping/function_type_return_internal.sol | 4 - .../mapping/library_argument_external.sol | 5 - .../mapping/library_argument_internal.sol | 4 - .../mapping/library_argument_private.sol | 4 - .../types/mapping/library_argument_public.sol | 5 - .../library_array_argument_external.sol | 6 - .../library_array_argument_internal.sol | 4 - .../library_array_argument_private.sol | 4 - .../mapping/library_array_argument_public.sol | 6 - .../types/mapping/library_mapping.sol | 4 - .../types/mapping/library_return_external.sol | 7 - .../types/mapping/library_return_internal.sol | 6 - .../types/mapping/library_return_private.sol | 6 - .../types/mapping/library_return_public.sol | 7 - ..._data_location_function_param_external.sol | 6 - .../mapping/mapping_array_return_external.sol | 6 - .../mapping/mapping_array_return_internal.sol | 16 - .../mapping/mapping_array_return_public.sol | 6 - .../mapping_data_location_calldata.sol | 9 - .../mapping/mapping_data_location_default.sol | 9 - ..._data_location_function_param_external.sol | 6 - ..._data_location_function_param_internal.sol | 6 - ...ng_data_location_function_param_public.sol | 5 - .../mapping/mapping_data_location_memory.sol | 9 - .../types/mapping/mapping_dynamic_key.sol | 3 - .../mapping/mapping_dynamic_key_public.sol | 4 - .../types/mapping/mapping_return_external.sol | 6 - .../types/mapping/mapping_return_internal.sol | 16 - .../types/mapping/mapping_return_public.sol | 6 - .../mapping/mapping_return_public_memory.sol | 6 - .../syntaxTests/types/no_singleton_tuple.sol | 8 - ...tional_negative_numerator_negative_exp.sol | 5 - .../rational_number_array_index_limit.sol | 5 - .../types/rational_number_bitshift_limit.sol | 13 - .../types/rational_number_div_limit.sol | 9 - .../types/rational_number_exp_limit_fail.sol | 47 - .../types/rational_number_exp_limit_fine.sol | 9 - .../types/rational_number_huge.sol | 10 - .../types/rational_number_huge_fail.sol | 8 - .../types/rational_number_literal_limit_1.sol | 9 - .../types/rational_number_literal_limit_2.sol | 9 - .../types/rational_number_literal_limit_3.sol | 9 - ...ional_number_literal_to_fixed_implicit.sol | 16 - .../types/rational_number_mul_limit.sol | 9 - .../rational_number_signed_to_unsigned.sol | 7 - .../types/rational_number_too_large.sol | 7 - .../types/too_small_negative_numbers.sol | 5 - .../syntaxTests/types/uint256_to_bytes1.sol | 7 - .../syntaxTests/types/uint32_to_bytes32.sol | 7 - .../syntaxTests/types/unnamed_tuple_decl.sol | 16 - .../types/var_decl_val_mismatch.sol | 16 - .../syntaxTests/types/var_empty_decl_0.sol | 9 - .../syntaxTests/types/var_empty_decl_1.sol | 8 - .../syntaxTests/types/var_empty_decl_2.sol | 9 - .../syntaxTests/types/var_empty_decl_3.sol | 7 - .../types/var_type_invalid_rational.sol | 8 - .../syntaxTests/types/var_type_suggest.sol | 30 - .../zero_literal_to_bytesXX_explicit.sol | 30 - .../zero_literal_to_bytesXX_implicit.sol | 30 - .../syntaxTests/unicode_escape_literals.sol | 31 - .../unimplemented_super_function.sol | 8 - .../unimplemented_super_function_derived.sol | 12 - .../unterminatedBlocks/one_dot.sol | 4 - .../unterminatedBlocks/one_dot_x.sol | 5 - .../unterminatedBlocks/zero_dot.sol | 4 - .../unterminatedBlocks/zero_dot_x.sol | 5 - .../syntaxTests/unusedVariables/try_catch.sol | 18 - .../syntaxTests/upper_case_hex_literals.sol | 9 - .../variableDeclaration/do_while.sol | 12 - .../syntaxTests/variableDeclaration/else.sol | 13 - .../syntaxTests/variableDeclaration/for.sol | 11 - .../syntaxTests/variableDeclaration/if.sol | 11 - .../syntaxTests/variableDeclaration/while.sol | 11 - .../viewPure/view_pure_abi_encode.sol | 8 - .../view_pure_abi_encode_arguments.sol | 36 - .../access_to_base_member_constant.sol | 10 - .../access_to_base_member_function.sol | 11 - .../access_to_base_member_struct.sol | 21 - .../access_to_base_members.sol | 15 - .../array/access_to_array_push.sol | 7 - .../array/access_to_array_push_view.sol | 8 - .../array/access_to_base_member_array.sol | 17 - .../syntaxTests/viewPureChecker/assembly.sol | 23 - .../viewPureChecker/builtin_functions.sol | 20 - .../builtin_functions_restrict_warning.sol | 21 - .../builtin_functions_view_fail.sol | 27 - .../call_internal_functions_fail.sol | 10 - .../call_internal_functions_success.sol | 6 - ...callvalue_nonpayable_assembly_fallback.sol | 10 - ...callvalue_nonpayable_assembly_function.sol | 10 - ..._nonpayable_assembly_function_internal.sol | 13 - ..._nonpayable_assembly_function_modifier.sol | 13 - .../callvalue_payable_assembly_fallback.sol | 11 - .../callvalue_payable_assembly_function.sol | 8 - ...lue_payable_assembly_function_modifier.sol | 12 - .../syntaxTests/viewPureChecker/constant.sol | 6 - .../constant_restrict_warning.sol | 12 - .../creation_no_restrict_warning.sol | 4 - .../viewPureChecker/creation_view_fail.sol | 6 - .../viewPureChecker/function_types.sol | 22 - .../viewPureChecker/function_types_fail.sol | 18 - .../gas_value_without_call.sol | 13 - .../gas_with_call_nonpayable.sol | 16 - .../syntaxTests/viewPureChecker/interface.sol | 7 - .../local_storage_variables.sol | 19 - .../local_storage_variables_fail.sol | 15 - .../syntaxTests/viewPureChecker/mappings.sol | 12 - .../syntaxTests/viewPureChecker/modifiers.sol | 17 - .../viewPureChecker/modifiers_fail.sol | 12 - .../viewPureChecker/msg_value_modifier.sol | 6 - .../msg_value_modifier_view.sol | 6 - .../viewPureChecker/overriding_fail.sol | 16 - .../overriding_no_restrict_warning.sol | 7 - .../read_storage_pure_fail.sol | 8 - .../returning_structs_fail.sol | 13 - .../returning_structs_no_restrict_warning.sol | 14 - .../syntaxTests/viewPureChecker/selector.sol | 12 - .../viewPureChecker/selector_complex.sol | 11 - .../viewPureChecker/selector_complex2.sol | 9 - .../viewPureChecker/smoke_test.sol | 7 - .../viewPureChecker/staticcall_gas_view.sol | 11 - .../viewPureChecker/suggest_pure.sol | 4 - .../viewPureChecker/suggest_view.sol | 6 - .../value_with_call_nonpayable.sol | 16 - .../viewPureChecker/write_storage_fail.sol | 6 - .../virtualLookup/modifiers_in_libraries.sol | 14 - .../visibility/external_library_function.sol | 14 - .../visibility/function_no_visibility.sol | 5 - .../visibility/interface/function_default.sol | 6 - .../interface/function_external.sol | 4 - .../interface/function_internal.sol | 5 - .../visibility/interface/function_private.sol | 5 - .../visibility/interface/function_public.sol | 5 - .../interface_contract_function_default.sol | 12 - .../visibility/library_self_delegatecall.sol | 13 - compiler/test/libsolidity/util/BytesUtils.cpp | 329 - compiler/test/libsolidity/util/BytesUtils.h | 128 - .../libsolidity/util/ContractABIUtils.cpp | 339 - .../test/libsolidity/util/ContractABIUtils.h | 96 - .../test/libsolidity/util/SoltestErrors.h | 122 - compiler/test/libsolidity/util/SoltestTypes.h | 272 - .../test/libsolidity/util/TestFileParser.cpp | 683 - .../test/libsolidity/util/TestFileParser.h | 191 - .../libsolidity/util/TestFileParserTests.cpp | 935 - .../libsolidity/util/TestFunctionCall.cpp | 308 - .../test/libsolidity/util/TestFunctionCall.h | 134 - .../util/TestFunctionCallTests.cpp | 255 - compiler/test/libsolutil/Checksum.cpp | 115 - compiler/test/libsolutil/CommonData.cpp | 142 - compiler/test/libsolutil/IndentedWriter.cpp | 74 - compiler/test/libsolutil/IpfsHash.cpp | 75 - compiler/test/libsolutil/IterateReplacing.cpp | 96 - compiler/test/libsolutil/JSON.cpp | 109 - compiler/test/libsolutil/Keccak256.cpp | 73 - compiler/test/libsolutil/StringUtils.cpp | 163 - compiler/test/libsolutil/SwarmHash.cpp | 102 - compiler/test/libsolutil/UTF8.cpp | 215 - compiler/test/libsolutil/Whiskers.cpp | 199 - compiler/test/libyul/Common.cpp | 108 - compiler/test/libyul/Common.h | 56 - compiler/test/libyul/CompilabilityChecker.cpp | 224 - compiler/test/libyul/EwasmTranslationTest.cpp | 157 - compiler/test/libyul/EwasmTranslationTest.h | 62 - compiler/test/libyul/FunctionSideEffects.cpp | 127 - compiler/test/libyul/FunctionSideEffects.h | 51 - compiler/test/libyul/Inliner.cpp | 110 - compiler/test/libyul/Metrics.cpp | 177 - compiler/test/libyul/ObjectCompilerTest.cpp | 129 - compiler/test/libyul/ObjectCompilerTest.h | 66 - compiler/test/libyul/ObjectParser.cpp | 296 - compiler/test/libyul/Parser.cpp | 616 - compiler/test/libyul/StackReuseCodegen.cpp | 351 - compiler/test/libyul/SyntaxTest.cpp | 139 - compiler/test/libyul/SyntaxTest.h | 53 - compiler/test/libyul/YulInterpreterTest.cpp | 145 - compiler/test/libyul/YulInterpreterTest.h | 68 - compiler/test/libyul/YulOptimizerTest.cpp | 457 - compiler/test/libyul/YulOptimizerTest.h | 85 - .../libyul/ewasmTranslationTests/address.yul | 9 - .../ewasmTranslationTests/arithmetic_add.yul | 35 - .../arithmetic_addmod.yul | 25 - .../ewasmTranslationTests/arithmetic_div.yul | 34 - .../ewasmTranslationTests/arithmetic_exp.yul | 40 - .../ewasmTranslationTests/arithmetic_mod.yul | 29 - .../ewasmTranslationTests/arithmetic_mul.yul | 36 - .../arithmetic_mulmod.yul | 27 - .../ewasmTranslationTests/arithmetic_sdiv.yul | 33 - .../ewasmTranslationTests/arithmetic_smod.yul | 33 - .../ewasmTranslationTests/arithmetic_sub.yul | 36 - .../libyul/ewasmTranslationTests/balance.yul | 12 - .../ewasmTranslationTests/bitwise_and.yul | 24 - .../ewasmTranslationTests/bitwise_not.yul | 25 - .../ewasmTranslationTests/bitwise_or.yul | 26 - .../ewasmTranslationTests/bitwise_xor.yul | 27 - .../ewasmTranslationTests/blockhash.yul | 9 - .../ewasmTranslationTests/calldatacopy.yul | 8 - .../ewasmTranslationTests/calldataload.yul | 7 - .../ewasmTranslationTests/calldatasize.yul | 7 - .../libyul/ewasmTranslationTests/caller.yul | 9 - .../ewasmTranslationTests/callvalue.yul | 9 - .../libyul/ewasmTranslationTests/chainid.yul | 10 - .../libyul/ewasmTranslationTests/codecopy.yul | 11 - .../libyul/ewasmTranslationTests/codesize.yul | 9 - .../libyul/ewasmTranslationTests/coinbase.yul | 9 - .../ewasmTranslationTests/comparison_eq.yul | 28 - .../ewasmTranslationTests/comparison_gt.yul | 36 - .../ewasmTranslationTests/comparison_lt.yul | 36 - .../ewasmTranslationTests/comparison_sgt.yul | 54 - .../ewasmTranslationTests/comparison_slt.yul | 55 - .../libyul/ewasmTranslationTests/datacopy.yul | 20 - .../ewasmTranslationTests/dataoffset.yul | 16 - .../libyul/ewasmTranslationTests/datasize.yul | 16 - .../ewasmTranslationTests/difficulty.yul | 9 - .../ewasmTranslationTests/extcodecopy.yul | 11 - .../ewasmTranslationTests/extcodehash.yul | 11 - .../ewasmTranslationTests/extcodesize.yul | 9 - .../test/libyul/ewasmTranslationTests/gas.yul | 9 - .../libyul/ewasmTranslationTests/gaslimit.yul | 9 - .../libyul/ewasmTranslationTests/gasprice.yul | 9 - .../libyul/ewasmTranslationTests/invalid.yul | 14 - .../libyul/ewasmTranslationTests/iszero.yul | 14 - .../ewasmTranslationTests/keccak256.yul | 9 - .../libyul/ewasmTranslationTests/log0.yul | 8 - .../libyul/ewasmTranslationTests/log1.yul | 8 - .../libyul/ewasmTranslationTests/log2.yul | 8 - .../libyul/ewasmTranslationTests/log3.yul | 8 - .../libyul/ewasmTranslationTests/log4.yul | 8 - .../libyul/ewasmTranslationTests/msize.yul | 12 - .../libyul/ewasmTranslationTests/mstore8.yul | 15 - .../ewasmTranslationTests/mstore_mload.yul | 14 - .../libyul/ewasmTranslationTests/number.yul | 9 - .../libyul/ewasmTranslationTests/origin.yul | 9 - .../test/libyul/ewasmTranslationTests/pc.yul | 8 - .../libyul/ewasmTranslationTests/return.yul | 11 - .../ewasmTranslationTests/returndatacopy.yul | 10 - .../ewasmTranslationTests/returndatasize.yul | 9 - .../libyul/ewasmTranslationTests/revert.yul | 13 - .../ewasmTranslationTests/selfbalance.yul | 10 - .../ewasmTranslationTests/selfdestruct.yul | 10 - .../libyul/ewasmTranslationTests/shifts.yul | 23 - .../ewasmTranslationTests/signextend.yul | 16 - .../ewasmTranslationTests/simple_mstore.yul | 8 - .../ewasmTranslationTests/simple_sload.yul | 16 - .../ewasmTranslationTests/simple_sstore.yul | 12 - .../libyul/ewasmTranslationTests/smoke.yul | 5 - .../ewasmTranslationTests/smoke_call.yul | 10 - .../ewasmTranslationTests/smoke_callcode.yul | 10 - .../ewasmTranslationTests/smoke_create.yul | 11 - .../ewasmTranslationTests/smoke_create2.yul | 13 - .../smoke_delegatecall.yul | 10 - .../smoke_staticcall.yul | 12 - .../ewasmTranslationTests/timestamp.yul | 9 - .../functionSideEffects/cyclic_graph.yul | 10 - .../doubly_recursive_function.yul | 8 - .../test/libyul/functionSideEffects/empty.yul | 4 - .../functionSideEffects/empty_with_sstore.yul | 5 - .../functionSideEffects/mload_in_function.yul | 11 - .../functionSideEffects/multi_calls.yul | 22 - .../recursive_function.yul | 6 - .../functionSideEffects/simple_functions.yul | 14 - .../libyul/functionSideEffects/structures.yul | 40 - .../libyul/functionSideEffects/with_loop.yul | 9 - compiler/test/libyul/objectCompiler/data.yul | 11 - .../test/libyul/objectCompiler/datacopy.yul | 48 - .../libyul/objectCompiler/dataoffset_code.yul | 29 - .../libyul/objectCompiler/dataoffset_data.yul | 16 - .../libyul/objectCompiler/dataoffset_self.yul | 16 - .../libyul/objectCompiler/datasize_code.yul | 29 - .../libyul/objectCompiler/datasize_data.yul | 16 - .../libyul/objectCompiler/datasize_self.yul | 16 - .../libyul/objectCompiler/function_series.yul | 30 - .../libyul/objectCompiler/namedObject.yul | 6 - .../libyul/objectCompiler/namedObjectCode.yul | 13 - .../objectCompiler/nested_optimizer.yul | 40 - .../test/libyul/objectCompiler/simple.yul | 13 - .../objectCompiler/simple_optimizer.yul | 19 - compiler/test/libyul/objectCompiler/smoke.yul | 5 - .../test/libyul/objectCompiler/subObject.yul | 21 - .../libyul/objectCompiler/subSubObject.yul | 39 - .../access_large_memory_offsets.yul | 14 - .../yulInterpreterTests/ambiguous_vars.yul | 14 - .../libyul/yulInterpreterTests/datacopy.yul | 18 - .../libyul/yulInterpreterTests/dataoffset.yul | 14 - .../libyul/yulInterpreterTests/datasize.yul | 14 - .../test/libyul/yulInterpreterTests/exp.yul | 8 - .../yulInterpreterTests/external_call.yul | 10 - .../yulInterpreterTests/function_calls.yul | 13 - .../yulInterpreterTests/function_scopes.yul | 20 - .../test/libyul/yulInterpreterTests/leave.yul | 20 - .../yulInterpreterTests/leave_for_init.yul | 18 - .../test/libyul/yulInterpreterTests/loop.yul | 10 - .../libyul/yulInterpreterTests/recursion.yul | 14 - .../recursive_function_for_loop.yul | 22 - .../yulInterpreterTests/shadowed_symbol.yul | 19 - .../yulInterpreterTests/side_effect_free.yul | 21 - .../yulInterpreterTests/simple_mstore.yul | 8 - .../test/libyul/yulInterpreterTests/smoke.yul | 5 - .../yulInterpreterTests/switch_statement.yul | 11 - .../blockFlattener/basic.yul | 21 - .../blockFlattener/for_stmt.yul | 12 - .../blockFlattener/if_stmt.yul | 21 - .../blockFlattener/many_nested_blocks.yul | 29 - .../blockFlattener/switch_stmt.yul | 23 - .../branches_for.yul | 23 - .../branches_if.yul | 13 - .../commonSubexpressionEliminator/case2.yul | 53 - .../clear_not_needed.yul | 21 - .../function_scopes.yul | 53 - .../commonSubexpressionEliminator/loop.yul | 77 - .../movable_functions.yul | 26 - .../non_movable_instr.yul | 11 - .../non_movable_instr2.yul | 11 - .../object_access.yul | 27 - .../commonSubexpressionEliminator/scopes.yul | 26 - .../commonSubexpressionEliminator/smoke.yul | 5 - .../commonSubexpressionEliminator/trivial.yul | 11 - .../unassigned_return.yul | 24 - .../unassigned_variables.yul | 15 - .../variable_for_variable.yul | 28 - .../clear_after_if_break.yul | 17 - .../clear_after_if_continue.yul | 17 - .../clear_before_for_condition.yul | 22 - .../clear_before_for_post.yul | 23 - .../no_opt_if_break_is_not_last.yul | 32 - .../no_opt_inside_if.yul | 13 - .../opt_after_terminating_if.yul | 18 - .../conditionalSimplifier/opt_switch.yul | 20 - .../conditionalSimplifier/smoke.yul | 5 - .../clear_after_if_break.yul | 15 - .../clear_after_if_continue.yul | 15 - .../clear_before_for_condition.yul | 22 - .../clear_before_for_post.yul | 21 - .../no_opt_if_break_is_not_last.yul | 34 - .../no_opt_inside_if.yul | 15 - .../opt_after_terminating_if.yul | 18 - .../conditionalUnsimplifier/opt_switch.yul | 22 - .../conditionalUnsimplifier/smoke.yul | 5 - .../constantOptimiser/difficult.yul | 15 - .../constantOptimiser/gaps.yul | 20 - .../constantOptimiser/smallNumbers.yul | 15 - .../empty_if_movable_condition.yul | 8 - .../empty_if_non_movable_condition.yul | 5 - .../controlFlowSimplifier/remove_leave.yul | 19 - .../switch_only_default.yul | 10 - .../switch_remove_empty_all.yul | 20 - .../switch_remove_empty_case.yul | 16 - .../switch_remove_empty_cases.yul | 14 - .../switch_remove_empty_default_case.yul | 16 - .../controlFlowSimplifier/switch_to_if.yul | 9 - .../controlFlowSimplifier/terminating_for.yul | 12 - .../terminating_for_nested.yul | 21 - .../terminating_for_nested_reversed.yul | 22 - .../terminating_for_revert.yul | 18 - .../terminating_for_revert_plus_break.yul | 20 - .../terminating_for_with_continue.yul | 18 - .../deadCodeEliminator/conditional_break.yul | 26 - .../deadCodeEliminator/early_break.yul | 27 - .../deadCodeEliminator/early_continue.yul | 27 - .../deadCodeEliminator/early_leave.yul | 36 - .../deadCodeEliminator/early_revert.yul | 24 - .../deadCodeEliminator/early_stop.yul | 24 - .../deadCodeEliminator/for_loop_init_decl.yul | 10 - .../function_after_revert.yul | 23 - .../deadCodeEliminator/nested_revert.yul | 27 - .../deadCodeEliminator/no_removal.yul | 13 - .../deadCodeEliminator/normal_break.yul | 25 - .../deadCodeEliminator/normal_continue.yul | 25 - .../deadCodeEliminator/normal_stop.yul | 31 - .../disambiguator/for_statement.yul | 19 - .../disambiguator/funtion_call.yul | 19 - .../disambiguator/if_statement.yul | 18 - .../disambiguator/long_names.yul | 13 - .../yulOptimizerTests/disambiguator/smoke.yul | 5 - .../disambiguator/smoke_yul.yul | 6 - .../disambiguator/switch_statement.yul | 22 - .../disambiguator/variables.yul | 9 - .../disambiguator/variables_clash.yul | 12 - .../variables_inside_functions.yul | 23 - .../multiple_complex.yul | 91 - .../equivalentFunctionCombiner/simple.yul | 17 - .../simple_different_vars.yul | 23 - .../switch_case_order.yul | 25 - .../argument_duplication_heuristic.yul | 41 - .../expressionInliner/complex_with_evm.yul | 12 - .../expressionInliner/double_calls.yul | 15 - .../double_recursive_calls.yul | 17 - .../expressionInliner/no_inline_mload.yul | 13 - .../no_move_with_sideeffects.yul | 26 - .../expressionInliner/simple.yul | 13 - .../expressionInliner/with_args.yul | 13 - .../expressionJoiner/if_condition.yul | 19 - .../expressionJoiner/muli_wrong_order3.yul | 14 - .../expressionJoiner/multi.yul | 12 - .../expressionJoiner/multi_reference.yul | 12 - .../expressionJoiner/multi_wrong_order.yul | 16 - .../expressionJoiner/multi_wrong_order2.yul | 13 - .../no_replacement_across_blocks.yul | 20 - .../no_replacement_in_loop_condition1.yul | 10 - .../no_replacement_in_loop_condition2.yul | 12 - .../expressionJoiner/only_assignment.yul | 17 - .../expressionJoiner/reassignment.yul | 14 - .../expressionJoiner/simple.yul | 11 - .../expressionJoiner/single_wrong_order.yul | 14 - .../expressionJoiner/smoke.yul | 5 - .../expressionJoiner/switch_expression.yul | 25 - .../expressionJoiner/triple.yul | 13 - .../assigned_vars_multi.yul | 14 - .../combine_shift_and_and.yul | 14 - .../combine_shift_and_and_2.yul | 24 - .../combine_shift_and_and_3.yul | 20 - .../constant_propagation.yul | 5 - .../expressionSimplifier/constants.yul | 5 - .../expressionSimplifier/create2_and_mask.yul | 12 - .../expressionSimplifier/create_and_mask.yul | 11 - .../identity_rules_complex.yul | 5 - .../identity_rules_negative.yul | 7 - .../identity_rules_simple.yul | 11 - .../including_function_calls.yul | 12 - .../expressionSimplifier/inside_for.yul | 12 - .../expressionSimplifier/invariant.yul | 11 - .../large_byte_access.yul | 16 - .../expressionSimplifier/mod_and_1.yul | 9 - .../expressionSimplifier/mod_and_2.yul | 9 - ...lied_function_call_different_arguments.yul | 12 - ..._applied_function_call_different_names.yul | 15 - ...ied_function_call_equality_not_movable.yul | 13 - ...d_removes_non_constant_and_not_movable.yul | 11 - .../expressionSimplifier/reassign.yul | 13 - .../remove_redundant_shift_masking.yul | 16 - .../replace_too_large_shift.yul | 16 - .../expressionSimplifier/return_vars_zero.yul | 13 - .../expressionSimplifier/reversed.yul | 7 - .../side_effects_in_for_condition.yul | 13 - .../expressionSimplifier/smoke.yul | 5 - .../unassigend_vars_multi.yul | 12 - .../expressionSimplifier/unassigned_vars.yul | 14 - .../expressionSplitter/control_flow.yul | 39 - .../expressionSplitter/inside_function.yul | 30 - .../expressionSplitter/object_access.yul | 25 - .../expressionSplitter/smoke.yul | 5 - .../expressionSplitter/switch.yul | 34 - .../expressionSplitter/trivial.yul | 15 - .../forLoopConditionIntoBody/cond_types.yul | 26 - .../forLoopConditionIntoBody/empty_body.yul | 12 - .../forLoopConditionIntoBody/nested.yul | 41 - .../forLoopConditionIntoBody/simple.yul | 17 - .../forLoopInitRewriter/complex_pre.yul | 17 - .../forLoopInitRewriter/empty_pre.yul | 14 - .../forLoopInitRewriter/nested.yul | 33 - .../forLoopInitRewriter/simple.yul | 15 - .../fullInliner/double_inline.yul | 31 - .../fullInliner/inside_condition.yul | 28 - .../fullInliner/large_function_multi_use.yul | 55 - .../fullInliner/large_function_single_use.yul | 37 - .../fullInliner/long_names.yul | 26 - .../move_up_rightwards_argument.yul | 30 - .../fullInliner/multi_fun.yul | 30 - .../fullInliner/multi_fun_callback.yul | 55 - .../fullInliner/multi_return.yul | 27 - .../no_inline_into_big_function.yul | 61 - .../no_inline_into_big_global_context.yul | 58 - .../fullInliner/no_inline_leave.yul | 22 - .../fullInliner/no_return.yul | 17 - .../fullInliner/not_inside_for.yul | 44 - .../fullInliner/pop_result.yul | 28 - .../fullInliner/recursion.yul | 14 - .../yulOptimizerTests/fullInliner/simple.yul | 25 - .../fullSimplify/constant_propagation.yul | 11 - .../fullSimplify/constants.yul | 8 - .../fullSimplify/identity_rules_complex.yul | 8 - .../fullSimplify/identity_rules_negative.yul | 11 - .../fullSimplify/identity_rules_simple.yul | 8 - .../fullSimplify/including_function_calls.yul | 13 - .../fullSimplify/inside_for.yul | 13 - .../fullSimplify/invariant.yul | 18 - .../fullSimplify/mod_and_1.yul | 10 - .../fullSimplify/mod_and_2.yul | 10 - ...lied_function_call_different_arguments.yul | 14 - ..._applied_function_call_different_names.yul | 16 - ...ied_function_call_equality_not_movable.yul | 14 - ...d_removes_non_constant_and_not_movable.yul | 13 - .../fullSimplify/operations.yul | 44 - .../fullSimplify/reversed.yul | 11 - .../fullSimplify/signextend.yul | 13 - .../yulOptimizerTests/fullSimplify/smoke.yul | 5 - .../yulOptimizerTests/fullSuite/abi2.yul | 1125 -- .../fullSuite/abi_example1.yul | 576 - .../yulOptimizerTests/fullSuite/aztec.yul | 383 - .../fullSuite/clear_after_if_continue.yul | 31 - .../fullSuite/devcon_example.yul | 33 - .../fullSuite/loopInvariantCodeMotion.yul | 37 - .../yulOptimizerTests/fullSuite/medium.yul | 30 - .../fullSuite/no_move_loop_orig.yul | 25 - ...remove_redundant_assignments_in_switch.yul | 20 - .../reuse_vars_bug_in_simplifier.yul | 15 - .../fullSuite/ssaReverse.yul | 56 - .../fullSuite/ssaReverseComplex.yul | 26 - .../fullSuite/stack_compressor_msize.yul | 45 - .../yulOptimizerTests/fullSuite/storage.yul | 15 - .../fullSuite/switch_inline.yul | 12 - .../fullSuite/switch_inline_match_default.yul | 13 - .../functionGrouper/already_grouped.yul | 14 - .../functionGrouper/empty_block.yul | 18 - .../grouped_but_not_ordered.yul | 14 - .../functionGrouper/multi_fun_mixed.yul | 21 - .../functionGrouper/nested_fun.yul | 24 - .../functionGrouper/single_fun.yul | 12 - .../functionGrouper/smoke.yul | 5 - .../functionHoister/empty_block.yul | 22 - .../functionHoister/multi_mixed.yul | 20 - .../functionHoister/nested.yul | 22 - .../functionHoister/single.yul | 13 - .../functionHoister/smoke.yul | 6 - .../yulOptimizerTests/loadResolver/loop.yul | 18 - ...y_with_different_kinds_of_invalidation.yul | 35 - .../loadResolver/memory_with_msize.yul | 17 - .../loadResolver/merge_known_write.yul | 22 - .../merge_known_write_with_distance.yul | 20 - .../loadResolver/merge_unknown_write.yul | 22 - .../loadResolver/merge_with_rewrite.yul | 23 - .../loadResolver/mload_in_function.yul | 29 - .../mstore_in_function_loop_body.yul | 35 - .../mstore_in_function_loop_init.yul | 32 - .../loadResolver/re_store_memory.yul | 21 - .../loadResolver/re_store_storage.yul | 21 - .../loadResolver/reassign.yul | 16 - .../reassign_value_expression.yul | 32 - .../loadResolver/second_mstore_with_delta.yul | 24 - .../loadResolver/second_store.yul | 19 - .../loadResolver/second_store_same_value.yul | 19 - .../loadResolver/second_store_with_delta.yul | 24 - .../side_effects_of_user_functions.yul | 28 - .../yulOptimizerTests/loadResolver/simple.yul | 14 - .../loadResolver/simple_memory.yul | 14 - .../loadResolver/staticcall.yul | 27 - .../dependOnVarInLoop.yul | 23 - .../loopInvariantCodeMotion/multi.yul | 26 - .../loopInvariantCodeMotion/no_move_loop.yul | 29 - .../no_move_recursive_function.yul | 26 - .../loopInvariantCodeMotion/non-ssavar.yul | 23 - .../loopInvariantCodeMotion/nonMovable.yul | 21 - .../loopInvariantCodeMotion/recursive.yul | 25 - .../loopInvariantCodeMotion/simple.yul | 21 - .../mainFunction/empty_block.yul | 27 - .../mainFunction/multi_fun_mixed.yul | 23 - .../mainFunction/nested_fun.yul | 23 - .../mainFunction/single_fun.yul | 14 - .../yulOptimizerTests/mainFunction/smoke.yul | 9 - .../nameDisplacer/funtion_call.yul | 25 - .../nameDisplacer/variables.yul | 11 - .../variables_inside_functions.yul | 16 - .../redundantAssignEliminator/for.yul | 18 - .../redundantAssignEliminator/for_branch.yul | 26 - .../redundantAssignEliminator/for_break.yul | 31 - .../for_continue.yul | 29 - .../for_continue_2.yul | 31 - .../for_continue_3.yul | 28 - .../for_decl_inside_break_continue.yul | 35 - .../for_deep_noremove.yul | 59 - .../for_deep_simple.yul | 45 - .../for_multi_break.yul | 74 - .../redundantAssignEliminator/for_nested.yul | 69 - .../redundantAssignEliminator/for_rerun.yul | 24 - .../for_stmnts_after_break_continue.yul | 49 - .../redundantAssignEliminator/function.yul | 24 - .../redundantAssignEliminator/if.yul | 22 - .../if_overwrite_all_branches.yul | 23 - .../if_used_in_one_branch.yul | 24 - .../redundantAssignEliminator/leave.yul | 40 - .../multi_assign.yul | 19 - .../redundantAssignEliminator/multivar.yul | 16 - .../redundantAssignEliminator/non_movable.yul | 12 - .../remove_break.yul | 26 - .../remove_continue.yul | 27 - .../redundantAssignEliminator/scopes.yul | 15 - .../redundantAssignEliminator/simple.yul | 9 - .../switch_overwrite_in_all.yul | 19 - .../switch_overwrite_in_one.yul | 18 - .../switch_overwrite_use_combination.yul | 20 - .../switch_unused.yul | 15 - .../rematerialiser/branches_for1.yul | 16 - .../rematerialiser/branches_for2.yul | 22 - .../rematerialiser/branches_if.yul | 19 - .../rematerialiser/branches_switch.yul | 23 - .../rematerialiser/cheap_caller.yul | 17 - .../do_not_move_out_of_scope.yul | 20 - ...mat_large_amounts_of_code_if_used_once.yul | 11 - .../rematerialiser/for_break.yul | 32 - .../rematerialiser/for_continue.yul | 34 - .../rematerialiser/for_continue_2.yul | 43 - .../for_continue_with_assignment_in_post.yul | 51 - .../rematerialiser/large_constant.yul | 13 - .../large_constant_used_once.yul | 14 - .../many_refs_small_cost_loop.yul | 28 - .../rematerialiser/medium_sized_constant.yul | 26 - .../rematerialiser/no_remat_in_loop.yul | 37 - .../rematerialiser/non_movable_function.yul | 18 - .../non_movable_instruction.yul | 15 - .../rematerialiser/reassign.yul | 22 - .../rematerialiser/reassignment.yul | 17 - .../rematerialiser/smoke.yul | 5 - .../some_refs_small_cost_loop.yul | 17 - .../some_refs_small_cost_nested_loop.yul | 26 - .../rematerialiser/trivial.yul | 13 - .../rematerialiser/update_asignment_remat.yul | 14 - .../splitJoin/control_flow.yul | 21 - .../yulOptimizerTests/splitJoin/functions.yul | 25 - .../yulOptimizerTests/splitJoin/smoke.yul | 5 - .../yulOptimizerTests/ssaAndBack/for_loop.yul | 30 - .../ssaAndBack/multi_assign.yul | 15 - .../ssaAndBack/multi_assign_if.yul | 18 - .../ssaAndBack/multi_assign_multi_var_if.yul | 26 - .../multi_assign_multi_var_switch.yul | 39 - .../ssaAndBack/multi_assign_switch.yul | 25 - .../yulOptimizerTests/ssaAndBack/simple.yul | 12 - .../ssaAndBack/single_assign_if.yul | 16 - .../ssaAndBack/single_assign_switch.yul | 21 - .../ssaAndBack/ssaReverse.yul | 43 - .../yulOptimizerTests/ssaAndBack/two_vars.yul | 21 - .../ssaPlusCleanup/control_structures.yul | 40 - .../ssaPlusCleanup/multi_reassign.yul | 18 - .../multi_reassign_with_use.yul | 18 - .../ssaReverser/abi_example.yul | 36 - .../ssaReverser/self_assign.yul | 8 - .../yulOptimizerTests/ssaReverser/simple.yul | 15 - .../ssaTransform/branches.yul | 27 - .../ssaTransform/for_reassign_body.yul | 28 - .../ssaTransform/for_reassign_init.yul | 30 - .../ssaTransform/for_reassign_post.yul | 28 - .../ssaTransform/for_simple.yul | 53 - .../ssaTransform/function.yul | 26 - .../ssaTransform/multi_assign.yul | 28 - .../ssaTransform/multi_decl.yul | 24 - .../yulOptimizerTests/ssaTransform/nested.yul | 34 - .../ssaTransform/nested_reassign.yul | 32 - .../ssaTransform/notransform.yul | 20 - .../yulOptimizerTests/ssaTransform/simple.yul | 19 - .../yulOptimizerTests/ssaTransform/switch.yul | 29 - .../ssaTransform/switch_reassign.yul | 23 - .../yulOptimizerTests/ssaTransform/used.yul | 41 - .../stackCompressor/inlineInBlock.yul | 11 - .../stackCompressor/inlineInFunction.yul | 17 - .../stackCompressor/noInline.yul | 12 - .../stackCompressor/unusedPrunerWithMSize.yul | 36 - .../bugfix_visit_after_change.yul | 12 - .../for_false_condition.sol | 9 - .../if_false_condition.yul | 5 - .../if_multi_unassigned_condition.yul | 9 - .../if_true_condition.yul | 5 - .../if_unassigned_condition.yul | 8 - .../structuralSimplifier/nested.yul | 5 - .../structuralSimplifier/switch_inline.yul | 13 - .../switch_inline_match_default.yul | 14 - .../switch_inline_no_match.yul | 10 - .../switch_inline_no_match_mixed.yul | 11 - .../switch_no_remove_empty_case.yul | 17 - .../unusedPruner/functions.yul | 8 - .../unusedPruner/intermediate_assignment.yul | 12 - .../intermediate_multi_assignment.yul | 16 - .../yulOptimizerTests/unusedPruner/keccak.yul | 12 - .../movable_user_defined_function.yul | 13 - .../yulOptimizerTests/unusedPruner/msize.yul | 12 - .../unusedPruner/multi_assign.yul | 16 - .../unusedPruner/multi_assignments.yul | 13 - .../unusedPruner/multi_declarations.yul | 7 - .../unusedPruner/multi_declare.yul | 8 - .../multi_partial_assignments.yul | 11 - .../unusedPruner/no_msize.yul | 9 - .../yulOptimizerTests/unusedPruner/pop.yul | 8 - .../yulOptimizerTests/unusedPruner/smoke.yul | 5 - .../unusedPruner/trivial.yul | 9 - .../varDeclInitializer/ambiguous.yul | 30 - .../varDeclInitializer/inside_func.yul | 25 - .../varDeclInitializer/multi.yul | 15 - .../varDeclInitializer/multi_assign.yul | 22 - .../varDeclInitializer/simple.yul | 7 - .../varNameCleaner/builtins.yul | 7 - .../varNameCleaner/function_names.yul | 14 - .../varNameCleaner/function_parameters.yul | 23 - .../varNameCleaner/function_scopes.yul | 13 - .../varNameCleaner/instructions.yul | 7 - .../varNameCleaner/name_stripping.yul | 15 - .../varNameCleaner/reshuffling-inverse.yul | 15 - .../varNameCleaner/reshuffling.yul | 13 - .../wordSizeTransform/constant_assignment.yul | 18 - .../wordSizeTransform/function_call.yul | 43 - .../functional_instruction.yul | 17 - .../wordSizeTransform/if.yul | 49 - .../wordSizeTransform/or_bool_renamed.yul | 25 - .../wordSizeTransform/switch_1.yul | 71 - .../wordSizeTransform/switch_2.yul | 77 - .../wordSizeTransform/switch_3.yul | 89 - .../wordSizeTransform/switch_4.yul | 97 - .../wordSizeTransform/switch_5.yul | 29 - .../yulSyntaxTests/simple_functions.yul | 10 - compiler/test/tools/CMakeLists.txt | 42 - compiler/test/tools/IsolTestOptions.cpp | 87 - compiler/test/tools/afl_fuzzer.cpp | 144 - compiler/test/tools/fuzzer_common.cpp | 143 - compiler/test/tools/isoltest.cpp | 476 - compiler/test/tools/ossfuzz/CMakeLists.txt | 150 - compiler/test/tools/ossfuzz/README.md | 28 - .../test/tools/ossfuzz/abiV2FuzzerCommon.cpp | 36 - .../test/tools/ossfuzz/abiV2FuzzerCommon.h | 34 - compiler/test/tools/ossfuzz/abiV2Proto.proto | 104 - .../test/tools/ossfuzz/abiV2ProtoFuzzer.cpp | 170 - .../ossfuzz/config/solc_noopt_ossfuzz.options | 2 - .../ossfuzz/config/solc_opt_ossfuzz.options | 2 - .../test/tools/ossfuzz/config/solidity.dict | 214 - .../tools/ossfuzz/config/strict_assembly.dict | 91 - .../config/strictasm_assembly_ossfuzz.options | 2 - .../config/strictasm_opt_ossfuzz.options | 2 - compiler/test/tools/ossfuzz/protoToAbiV2.cpp | 1208 -- compiler/test/tools/ossfuzz/protoToAbiV2.h | 934 - compiler/test/tools/ossfuzz/protoToYul.cpp | 1875 -- compiler/test/tools/ossfuzz/protoToYul.h | 385 - .../ossfuzz/strictasm_assembly_ossfuzz.cpp | 54 - .../tools/ossfuzz/strictasm_diff_ossfuzz.cpp | 100 - .../test/tools/ossfuzz/yulFuzzerCommon.cpp | 69 - compiler/test/tools/ossfuzz/yulFuzzerCommon.h | 44 - .../ossfuzz/yulOptimizerFuzzDictionary.h | 777 - compiler/test/tools/ossfuzz/yulProto.proto | 415 - .../test/tools/ossfuzz/yulProtoFuzzer.cpp | 72 - .../tools/ossfuzz/yulProto_diff_ossfuzz.cpp | 109 - .../test/tools/yulInterpreter/CMakeLists.txt | 11 - .../EVMInstructionInterpreter.cpp | 509 - .../EVMInstructionInterpreter.h | 98 - .../EwasmBuiltinInterpreter.cpp | 514 - .../yulInterpreter/EwasmBuiltinInterpreter.h | 124 - .../test/tools/yulInterpreter/Interpreter.cpp | 323 - .../test/tools/yulInterpreter/Interpreter.h | 205 - compiler/test/tools/yulopti.cpp | 242 - compiler/test/tools/yulrun.cpp | 151 - compiler/test/yulPhaser/Chromosome.cpp | 101 - compiler/test/yulPhaser/Population.cpp | 179 - compiler/test/yulPhaser/Program.cpp | 286 - compiler/test/yulPhaser/Random.cpp | 95 - compiler/tools/CMakeLists.txt | 32 +- .../tools/solidityUpgrade/SourceTransform.h | 222 +- .../tools/solidityUpgrade/SourceUpgrade.cpp | 47 +- .../tools/solidityUpgrade/SourceUpgrade.h | 35 +- compiler/tools/solidityUpgrade/Upgrade050.cpp | 15 +- compiler/tools/solidityUpgrade/Upgrade050.h | 5 +- compiler/tools/solidityUpgrade/Upgrade060.cpp | 169 +- compiler/tools/solidityUpgrade/Upgrade060.h | 16 +- compiler/tools/solidityUpgrade/Upgrade070.cpp | 85 + compiler/tools/solidityUpgrade/Upgrade070.h | 53 + .../tools/solidityUpgrade/UpgradeChange.cpp | 23 +- .../tools/solidityUpgrade/UpgradeChange.h | 31 +- compiler/tools/solidityUpgrade/UpgradeSuite.h | 15 +- compiler/tools/solidityUpgrade/main.cpp | 18 +- compiler/tools/yulPhaser/AlgorithmRunner.cpp | 203 + compiler/tools/yulPhaser/AlgorithmRunner.h | 100 + compiler/tools/yulPhaser/Chromosome.cpp | 35 +- compiler/tools/yulPhaser/Chromosome.h | 24 +- .../yulPhaser/Common.cpp} | 41 +- compiler/tools/yulPhaser/Common.h | 78 + compiler/tools/yulPhaser/Exceptions.h | 10 +- compiler/tools/yulPhaser/FitnessMetrics.cpp | 120 + compiler/tools/yulPhaser/FitnessMetrics.h | 191 + .../tools/yulPhaser/GeneticAlgorithms.cpp | 176 + compiler/tools/yulPhaser/GeneticAlgorithms.h | 225 + compiler/tools/yulPhaser/Mutations.cpp | 303 + compiler/tools/yulPhaser/Mutations.h | 102 + compiler/tools/yulPhaser/PairSelections.cpp | 107 + compiler/tools/yulPhaser/PairSelections.h | 123 + compiler/tools/yulPhaser/Phaser.cpp | 884 + compiler/tools/yulPhaser/Phaser.h | 285 + compiler/tools/yulPhaser/Population.cpp | 185 +- compiler/tools/yulPhaser/Population.h | 102 +- compiler/tools/yulPhaser/Program.cpp | 98 +- compiler/tools/yulPhaser/Program.h | 19 +- compiler/tools/yulPhaser/ProgramCache.cpp | 154 + compiler/tools/yulPhaser/ProgramCache.h | 144 + compiler/tools/yulPhaser/README.md | 95 + compiler/tools/yulPhaser/Random.cpp | 44 - compiler/tools/yulPhaser/Selections.cpp | 71 + compiler/tools/yulPhaser/Selections.h | 145 + compiler/tools/yulPhaser/SimulationRNG.cpp | 66 + compiler/tools/yulPhaser/SimulationRNG.h | 59 + compiler/tools/yulPhaser/main.cpp | 151 +- sold/Cargo.toml | 13 +- sold/README.md | 8 +- sold/build.rs | 15 +- sold/src/bindings-freebsd.rs | 29 + sold/src/bindings-linux.rs | 29 + sold/src/bindings-macos.rs | 29 + sold/src/bindings-windows.rs | 29 + sold/src/lib.rs | 259 +- sold/tests/ImportRemote.sol | 4 + sold/tests/remote/Remote.sol | 3 + sold/tests/tests.rs | 21 +- 4136 files changed, 53231 insertions(+), 146157 deletions(-) create mode 100644 compiler/.clang-format create mode 100644 compiler/.editorconfig delete mode 100644 compiler/.travis.yml create mode 100644 compiler/README.md create mode 100644 compiler/SECURITY.md delete mode 100644 compiler/appveyor.yml create mode 100644 compiler/cmake/fmtlib.cmake create mode 100644 compiler/cmake/range-v3.cmake create mode 100644 compiler/cmake/templates/ewasm_polyfill.in delete mode 100644 compiler/cmake/toolchains/cxx17.cmake delete mode 100644 compiler/cmake/toolchains/cxx20.cmake delete mode 100644 compiler/cmake/toolchains/emscripten.cmake create mode 100644 compiler/docs/070-breaking-changes.rst create mode 100644 compiler/docs/080-breaking-changes.rst create mode 100644 compiler/docs/_static/css/dark.css create mode 100644 compiler/docs/_static/css/toggle.css create mode 100644 compiler/docs/_static/img/solid-share-arrow.svg create mode 100644 compiler/docs/_static/js/toggle.js create mode 100644 compiler/docs/_templates/footer.html create mode 100644 compiler/docs/_templates/versions.html create mode 100644 compiler/docs/analysing-compilation-output.rst create mode 100644 compiler/docs/brand-guide.rst create mode 100644 compiler/docs/cheatsheet.rst create mode 100644 compiler/docs/contracts/errors.rst create mode 100644 compiler/docs/credits-and-attribution.rst rename compiler/{scripts => docs}/docs.sh (86%) create mode 100644 compiler/docs/ext/html_extra_template_renderer.py create mode 100644 compiler/docs/ext/remix_code_links.py create mode 100644 compiler/docs/grammar.rst delete mode 100644 compiler/docs/grammar.txt create mode 100644 compiler/docs/grammar/SolidityLexer.g4 create mode 100644 compiler/docs/grammar/SolidityParser.g4 create mode 100644 compiler/docs/internals/layout_in_calldata.rst create mode 100644 compiler/docs/internals/layout_in_memory.rst create mode 100644 compiler/docs/internals/layout_in_storage.rst create mode 100644 compiler/docs/internals/optimizer.rst create mode 100644 compiler/docs/internals/source_mappings.rst create mode 100644 compiler/docs/internals/variable_cleanup.rst create mode 100644 compiler/docs/ir-breaking-changes.rst create mode 100644 compiler/docs/language-influences.rst delete mode 100644 compiler/docs/lll.rst delete mode 100644 compiler/docs/miscellaneous.rst create mode 100644 compiler/docs/path-resolution.rst create mode 100644 compiler/docs/robots.txt.template create mode 100644 compiler/docs/smtchecker.rst delete mode 100644 compiler/docs/solidity-in-depth.rst create mode 100644 compiler/docs/types/operator-precedence-table.rst create mode 100644 compiler/lib/stdlib_sol.tvm create mode 100644 compiler/liblangutil/CharStreamProvider.h create mode 100644 compiler/liblangutil/DebugInfoSelection.cpp create mode 100644 compiler/liblangutil/DebugInfoSelection.h delete mode 100644 compiler/liblangutil/EVMVersion.cpp delete mode 100644 compiler/liblangutil/SourceReferenceFormatterHuman.h create mode 100644 compiler/liblangutil/UniqueErrorReporter.h create mode 100644 compiler/libsmtutil/CHCSmtLib2Interface.cpp create mode 100644 compiler/libsmtutil/CHCSmtLib2Interface.h create mode 100644 compiler/libsmtutil/CHCSolverInterface.h create mode 100644 compiler/libsmtutil/CMakeLists.txt create mode 100644 compiler/libsmtutil/CVC4Interface.cpp create mode 100644 compiler/libsmtutil/CVC4Interface.h create mode 100644 compiler/libsmtutil/Exceptions.h create mode 100644 compiler/libsmtutil/Helpers.h create mode 100644 compiler/libsmtutil/SMTLib2Interface.cpp create mode 100644 compiler/libsmtutil/SMTLib2Interface.h create mode 100644 compiler/libsmtutil/SMTPortfolio.cpp create mode 100644 compiler/libsmtutil/SMTPortfolio.h create mode 100644 compiler/libsmtutil/SolverInterface.h rename compiler/{test/tools/ossfuzz/solc_opt_ossfuzz.cpp => libsmtutil/Sorts.cpp} (55%) create mode 100644 compiler/libsmtutil/Sorts.h create mode 100644 compiler/libsmtutil/Z3CHCInterface.cpp create mode 100644 compiler/libsmtutil/Z3CHCInterface.h create mode 100644 compiler/libsmtutil/Z3Interface.cpp create mode 100644 compiler/libsmtutil/Z3Interface.h create mode 100644 compiler/libsmtutil/Z3Loader.cpp rename compiler/{test/tools/ossfuzz/const_opt_ossfuzz.cpp => libsmtutil/Z3Loader.h} (64%) create mode 100755 compiler/libsmtutil/genz3wrapper.py create mode 100644 compiler/libsolidity/analysis/ControlFlowRevertPruner.cpp create mode 100644 compiler/libsolidity/analysis/ControlFlowRevertPruner.h create mode 100644 compiler/libsolidity/analysis/DeclarationTypeChecker.cpp create mode 100644 compiler/libsolidity/analysis/DeclarationTypeChecker.h create mode 100644 compiler/libsolidity/analysis/DocStringTagParser.cpp create mode 100644 compiler/libsolidity/analysis/DocStringTagParser.h create mode 100644 compiler/libsolidity/analysis/FunctionCallGraph.cpp create mode 100644 compiler/libsolidity/analysis/FunctionCallGraph.h create mode 100644 compiler/libsolidity/analysis/ImmutableValidator.cpp create mode 100644 compiler/libsolidity/analysis/ImmutableValidator.h create mode 100644 compiler/libsolidity/analysis/PostTypeContractLevelChecker.cpp create mode 100644 compiler/libsolidity/analysis/PostTypeContractLevelChecker.h create mode 100644 compiler/libsolidity/analysis/Scoper.cpp create mode 100644 compiler/libsolidity/analysis/Scoper.h rename compiler/libsolidity/ast/{ASTJsonConverter.cpp => ASTJsonExporter.cpp} (59%) rename compiler/libsolidity/ast/{ASTJsonConverter.h => ASTJsonExporter.h} (83%) delete mode 100644 compiler/libsolidity/ast/AsmJsonImporter.cpp delete mode 100644 compiler/libsolidity/ast/AsmJsonImporter.h create mode 100644 compiler/libsolidity/ast/CallGraph.cpp create mode 100644 compiler/libsolidity/ast/CallGraph.h create mode 100644 compiler/libsolidity/interface/FileReader.cpp create mode 100644 compiler/libsolidity/interface/FileReader.h create mode 100644 compiler/libsolidity/interface/ImportRemapper.cpp create mode 100644 compiler/libsolidity/interface/ImportRemapper.h create mode 100644 compiler/libsolidity/interface/StorageLayout.cpp create mode 100644 compiler/libsolidity/interface/StorageLayout.h create mode 100644 compiler/libsolidity/lsp/FileRepository.cpp create mode 100644 compiler/libsolidity/lsp/FileRepository.h create mode 100644 compiler/libsolidity/lsp/GotoDefinition.cpp rename compiler/{tools/yulPhaser/Random.h => libsolidity/lsp/GotoDefinition.h} (70%) create mode 100644 compiler/libsolidity/lsp/HandlerBase.cpp create mode 100644 compiler/libsolidity/lsp/HandlerBase.h create mode 100644 compiler/libsolidity/lsp/LanguageServer.cpp create mode 100644 compiler/libsolidity/lsp/LanguageServer.h create mode 100644 compiler/libsolidity/lsp/RenameSymbol.cpp create mode 100644 compiler/libsolidity/lsp/RenameSymbol.h create mode 100644 compiler/libsolidity/lsp/SemanticTokensBuilder.cpp create mode 100644 compiler/libsolidity/lsp/SemanticTokensBuilder.h create mode 100644 compiler/libsolidity/lsp/Transport.cpp create mode 100644 compiler/libsolidity/lsp/Transport.h create mode 100644 compiler/libsolidity/lsp/Utils.cpp create mode 100644 compiler/libsolidity/lsp/Utils.h create mode 100644 compiler/libsolutil/ErrorCodes.h rename compiler/{test/tools/fuzzer_common.h => libsolutil/FunctionSelector.h} (51%) delete mode 100644 compiler/libsolutil/InvertibleMap.h create mode 100644 compiler/libsolutil/LEB128.h create mode 100644 compiler/libsolutil/LazyInit.h rename compiler/{test/libsolidity/ErrorCheck.h => libsolutil/Numeric.cpp} (53%) create mode 100644 compiler/libsolutil/Numeric.h create mode 100644 compiler/libsolutil/SetOnce.h rename compiler/{test/libsolidity/ABITestsCommon.h => libsolutil/StackTooDeepString.h} (69%) rename compiler/{test/tools/ossfuzz/solc_noopt_ossfuzz.cpp => libsolutil/Views.h} (61%) create mode 100644 compiler/libsolutil/cxx20.h create mode 100755 compiler/scripts/bytecodecompare/prepare_report.js create mode 100755 compiler/scripts/check_symlinks.sh create mode 100755 compiler/scripts/chk_shellscripts/chk_shellscripts.sh create mode 100644 compiler/scripts/ci/base64DecToArr.js create mode 100755 compiler/scripts/ci/build.sh create mode 100755 compiler/scripts/ci/build_emscripten.sh create mode 100755 compiler/scripts/ci/build_ossfuzz.sh create mode 120000 compiler/scripts/ci/buildpack-deps_test_emscripten.sh create mode 120000 compiler/scripts/ci/buildpack-deps_test_ubuntu1604.clang.ossfuzz.sh create mode 120000 compiler/scripts/ci/buildpack-deps_test_ubuntu1804.sh create mode 120000 compiler/scripts/ci/buildpack-deps_test_ubuntu2004.clang.sh create mode 120000 compiler/scripts/ci/buildpack-deps_test_ubuntu2004.sh create mode 100755 compiler/scripts/ci/docker_upgrade.sh create mode 100644 compiler/scripts/ci/mini-lz4.js create mode 100755 compiler/scripts/ci/pack_soljson.sh create mode 100755 compiler/scripts/ci/post_style_errors_on_github.sh create mode 100644 compiler/scripts/codespell_ignored_lines.txt create mode 100644 compiler/scripts/common/git_helpers.py create mode 100644 compiler/scripts/common/rest_api_helpers.py create mode 100644 compiler/scripts/common_cmdline.sh create mode 100644 compiler/scripts/docker/buildpack-deps/Dockerfile.emscripten create mode 100644 compiler/scripts/docker/buildpack-deps/Dockerfile.ubuntu1604.clang.ossfuzz create mode 100644 compiler/scripts/docker/buildpack-deps/Dockerfile.ubuntu2004 create mode 100644 compiler/scripts/docker/buildpack-deps/Dockerfile.ubuntu2004.clang create mode 100644 compiler/scripts/docker/buildpack-deps/README.md rename compiler/scripts/{travis-emscripten => docker/buildpack-deps}/emscripten.jam (96%) delete mode 100755 compiler/scripts/docker_build.sh delete mode 100755 compiler/scripts/docker_deploy.sh create mode 100755 compiler/scripts/docs_version_pragma_check.sh create mode 100755 compiler/scripts/endToEndExtraction/create_traces.sh create mode 100755 compiler/scripts/endToEndExtraction/remove-testcases.py create mode 100755 compiler/scripts/endToEndExtraction/verify-testcases.py create mode 100755 compiler/scripts/error_codes.py create mode 100755 compiler/scripts/externalTests/benchmark_diff.py create mode 100755 compiler/scripts/externalTests/download_benchmarks.py create mode 100755 compiler/scripts/externalTests/merge_benchmarks.sh create mode 100755 compiler/scripts/externalTests/parse_eth_gas_report.py create mode 100755 compiler/scripts/externalTests/summarize_benchmarks.sh create mode 100755 compiler/scripts/externalTests/update_external_repos.sh create mode 100755 compiler/scripts/gas_diff_stats.py rename compiler/scripts/{release_emscripten.sh => get_nightly_version.sh} (64%) delete mode 100644 compiler/scripts/install_deps.bat delete mode 100644 compiler/scripts/install_deps.cmake create mode 100644 compiler/scripts/install_deps.ps1 create mode 100644 compiler/scripts/install_evmone.ps1 delete mode 100644 compiler/scripts/release.bat delete mode 100755 compiler/scripts/release.sh delete mode 100755 compiler/scripts/report_errors.sh create mode 100755 compiler/scripts/solc-bin/bytecode_reports_for_modified_binaries.sh create mode 100755 compiler/scripts/solc-bin/compare_bytecode_reports.sh create mode 100755 compiler/scripts/test_antlr_grammar.sh delete mode 100755 compiler/scripts/travis-emscripten/build_emscripten.sh delete mode 100644 compiler/scripts/travis-emscripten/deploy_key.enc delete mode 100755 compiler/scripts/travis-emscripten/install_deps.sh create mode 100644 compiler/scripts/wasm-rebuild/README create mode 100755 compiler/scripts/wasm-rebuild/docker-scripts/genbytecode.sh create mode 100755 compiler/scripts/wasm-rebuild/docker-scripts/isolate_tests.py create mode 100755 compiler/scripts/wasm-rebuild/docker-scripts/patch.sh create mode 100755 compiler/scripts/wasm-rebuild/docker-scripts/rebuild_current.sh create mode 100755 compiler/scripts/wasm-rebuild/docker-scripts/rebuild_tags.sh create mode 100755 compiler/scripts/wasm-rebuild/rebuild.sh create mode 100755 compiler/scripts/yul_coverage.sh create mode 100644 compiler/solc/CommandLineParser.cpp create mode 100644 compiler/solc/CommandLineParser.h rename compiler/{test/tools/IsolTestOptions.h => solc/Exceptions.h} (63%) delete mode 100644 compiler/test/.solhint.json delete mode 100644 compiler/test/.solhintignore delete mode 100644 compiler/test/CMakeLists.txt delete mode 100644 compiler/test/Common.cpp delete mode 100644 compiler/test/Common.h delete mode 100644 compiler/test/CommonSyntaxTest.cpp delete mode 100644 compiler/test/CommonSyntaxTest.h delete mode 100644 compiler/test/EVMHost.cpp delete mode 100644 compiler/test/EVMHost.h delete mode 100644 compiler/test/ExecutionFramework.cpp delete mode 100644 compiler/test/ExecutionFramework.h delete mode 100644 compiler/test/InteractiveTests.h delete mode 100644 compiler/test/Metadata.cpp delete mode 100644 compiler/test/Metadata.h delete mode 100644 compiler/test/TestCase.cpp delete mode 100644 compiler/test/TestCase.h delete mode 100644 compiler/test/boostTest.cpp delete mode 100755 compiler/test/buglistTests.js delete mode 100644 compiler/test/buglist_test_vectors.md delete mode 100755 compiler/test/cmdlineTests.sh delete mode 100644 compiler/test/cmdlineTests/abiencoderv2_no_warning/args delete mode 100644 compiler/test/cmdlineTests/abiencoderv2_no_warning/err delete mode 100644 compiler/test/cmdlineTests/abiencoderv2_no_warning/exit delete mode 100644 compiler/test/cmdlineTests/abiencoderv2_no_warning/input.sol delete mode 100644 compiler/test/cmdlineTests/abiencoderv2_no_warning/output delete mode 100644 compiler/test/cmdlineTests/ast_json_import_wrong_evmVersion/args delete mode 100644 compiler/test/cmdlineTests/ast_json_import_wrong_evmVersion/err delete mode 100644 compiler/test/cmdlineTests/ast_json_import_wrong_evmVersion/exit delete mode 100644 compiler/test/cmdlineTests/ast_json_import_wrong_evmVersion/input.sol delete mode 100644 compiler/test/cmdlineTests/evm_to_wasm/args delete mode 100644 compiler/test/cmdlineTests/evm_to_wasm/err delete mode 100644 compiler/test/cmdlineTests/evm_to_wasm/input.sol delete mode 100644 compiler/test/cmdlineTests/evm_to_wasm/output delete mode 100644 compiler/test/cmdlineTests/object_compiler/args delete mode 100644 compiler/test/cmdlineTests/object_compiler/err delete mode 100644 compiler/test/cmdlineTests/object_compiler/exit delete mode 100644 compiler/test/cmdlineTests/object_compiler/input.sol delete mode 100644 compiler/test/cmdlineTests/object_compiler/output delete mode 100644 compiler/test/cmdlineTests/output_selection_all_A1/input.json delete mode 100644 compiler/test/cmdlineTests/output_selection_all_A1/output.json delete mode 100644 compiler/test/cmdlineTests/output_selection_all_A2/input.json delete mode 100644 compiler/test/cmdlineTests/output_selection_all_A2/output.json delete mode 100644 compiler/test/cmdlineTests/output_selection_all_blank/input.json delete mode 100644 compiler/test/cmdlineTests/output_selection_all_blank/output.json delete mode 100644 compiler/test/cmdlineTests/output_selection_all_star/input.json delete mode 100644 compiler/test/cmdlineTests/output_selection_all_star/output.json delete mode 100644 compiler/test/cmdlineTests/output_selection_single_A1/input.json delete mode 100644 compiler/test/cmdlineTests/output_selection_single_A1/output.json delete mode 100644 compiler/test/cmdlineTests/output_selection_single_B1/input.json delete mode 100644 compiler/test/cmdlineTests/output_selection_single_B1/output.json delete mode 100644 compiler/test/cmdlineTests/output_selection_single_all/input.json delete mode 100644 compiler/test/cmdlineTests/output_selection_single_all/output.json delete mode 100644 compiler/test/cmdlineTests/recovery_ast_constructor/args delete mode 100644 compiler/test/cmdlineTests/recovery_ast_constructor/err delete mode 100644 compiler/test/cmdlineTests/recovery_ast_constructor/input.sol delete mode 100644 compiler/test/cmdlineTests/recovery_ast_constructor/output delete mode 100644 compiler/test/cmdlineTests/recovery_ast_empty_contract/args delete mode 100644 compiler/test/cmdlineTests/recovery_ast_empty_contract/err delete mode 100644 compiler/test/cmdlineTests/recovery_ast_empty_contract/input.sol delete mode 100644 compiler/test/cmdlineTests/recovery_standard_json/input.json delete mode 100644 compiler/test/cmdlineTests/recovery_standard_json/output.json delete mode 100644 compiler/test/cmdlineTests/require_overload/err delete mode 100644 compiler/test/cmdlineTests/require_overload/exit delete mode 100644 compiler/test/cmdlineTests/require_overload/input.sol delete mode 100644 compiler/test/cmdlineTests/standard_default_success/exit delete mode 100644 compiler/test/cmdlineTests/standard_default_success/input.json delete mode 100644 compiler/test/cmdlineTests/standard_default_success/output.json delete mode 100644 compiler/test/cmdlineTests/standard_eWasm_requested/input.json delete mode 100644 compiler/test/cmdlineTests/standard_eWasm_requested/output.json delete mode 100644 compiler/test/cmdlineTests/standard_irOptimized_requested/input.json delete mode 100644 compiler/test/cmdlineTests/standard_irOptimized_requested/output.json delete mode 100644 compiler/test/cmdlineTests/standard_ir_requested/input.json delete mode 100644 compiler/test/cmdlineTests/standard_ir_requested/output.json delete mode 100644 compiler/test/cmdlineTests/standard_method_identifiers_requested/input.json delete mode 100644 compiler/test/cmdlineTests/standard_method_identifiers_requested/output.json delete mode 100644 compiler/test/cmdlineTests/standard_missing_key_useLiteralContent/exit delete mode 100644 compiler/test/cmdlineTests/standard_missing_key_useLiteralContent/input.json delete mode 100644 compiler/test/cmdlineTests/standard_missing_key_useLiteralContent/output.json delete mode 100644 compiler/test/cmdlineTests/standard_only_ast_requested/input.json delete mode 100644 compiler/test/cmdlineTests/standard_only_ast_requested/output.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_invalid_detail_type/input.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_invalid_detail_type/output.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_invalid_details/input.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_invalid_details/output.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_no_yul/input.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_no_yul/output.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_yul/input.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_yul/output.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_yulDetails/input.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_yulDetails/output.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_yulDetails_no_object/input.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_yulDetails_no_object/output.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_yulDetails_without_yul/input.json delete mode 100644 compiler/test/cmdlineTests/standard_optimizer_yulDetails_without_yul/output.json delete mode 100644 compiler/test/cmdlineTests/standard_secondary_source_location/exit delete mode 100644 compiler/test/cmdlineTests/standard_secondary_source_location/input.json delete mode 100644 compiler/test/cmdlineTests/standard_secondary_source_location/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_auxiliary_input/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_auxiliary_input/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_auxiliary_input/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_metadata/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_metadata/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_metadata/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_optimizer/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_optimizer/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_optimizer/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_root/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_root/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_root/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_settings/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_settings/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_settings/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_source/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_source/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_key_source/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_auxiliary_input/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_auxiliary_input/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_auxiliary_input/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_auxiliary_input_smtlib2responses/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_auxiliary_input_smtlib2responses/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_auxiliary_input_smtlib2responses/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_auxiliary_input_smtlib2responses_member/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_auxiliary_input_smtlib2responses_member/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_auxiliary_input_smtlib2responses_member/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_metadata/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_metadata/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_metadata/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_optimizer/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_optimizer/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_optimizer/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_output_selection/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_output_selection/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_output_selection/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_output_selection_contract/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_output_selection_contract/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_output_selection_contract/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_output_selection_file/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_output_selection_file/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_output_selection_file/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_output_selection_output/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_output_selection_output/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_output_selection_output/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_remappings/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_remappings/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_remappings/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_remappings_entry/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_remappings_entry/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_remappings_entry/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_root/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_root/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_root/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_settings/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_settings/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_settings/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_source/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_source/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_source/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_sources/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_sources/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_sources/output.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_useLiteralContent/exit delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_useLiteralContent/input.json delete mode 100644 compiler/test/cmdlineTests/standard_wrong_type_useLiteralContent/output.json delete mode 100644 compiler/test/cmdlineTests/standard_yul/input.json delete mode 100644 compiler/test/cmdlineTests/standard_yul/output.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_embedded_object_name/input.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_embedded_object_name/output.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_invalid_object_name/input.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_invalid_object_name/output.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_multiple_files/input.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_multiple_files/output.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_multiple_files_selected/input.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_multiple_files_selected/output.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_object/input.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_object/output.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_object_name/input.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_object_name/output.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_optimized/input.json delete mode 100644 compiler/test/cmdlineTests/standard_yul_optimized/output.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_bytes/input.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_bytes/output.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_dyn_array/input.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_dyn_array/output.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_many/input.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_many/output.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_mapping/input.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_mapping/output.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_smoke/input.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_smoke/output.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_smoke_two_contracts/input.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_smoke_two_contracts/output.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_string/input.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_string/output.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_struct/input.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_struct/output.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_struct_packed/input.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_struct_packed/output.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_value_types/input.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_value_types/output.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_value_types_packed/input.json delete mode 100644 compiler/test/cmdlineTests/storage_layout_value_types_packed/output.json delete mode 100644 compiler/test/cmdlineTests/strict_asm_jump/args delete mode 100644 compiler/test/cmdlineTests/strict_asm_jump/err delete mode 100644 compiler/test/cmdlineTests/strict_asm_jump/exit delete mode 100644 compiler/test/cmdlineTests/strict_asm_jump/input.sol delete mode 100644 compiler/test/cmdlineTests/too_long_line/err delete mode 100644 compiler/test/cmdlineTests/too_long_line/exit delete mode 100644 compiler/test/cmdlineTests/too_long_line/input.sol delete mode 100644 compiler/test/cmdlineTests/too_long_line_both_sides_short/err delete mode 100644 compiler/test/cmdlineTests/too_long_line_both_sides_short/exit delete mode 100644 compiler/test/cmdlineTests/too_long_line_both_sides_short/input.sol delete mode 100644 compiler/test/cmdlineTests/too_long_line_edge_in/err delete mode 100644 compiler/test/cmdlineTests/too_long_line_edge_in/exit delete mode 100644 compiler/test/cmdlineTests/too_long_line_edge_in/input.sol delete mode 100644 compiler/test/cmdlineTests/too_long_line_edge_out/err delete mode 100644 compiler/test/cmdlineTests/too_long_line_edge_out/exit delete mode 100644 compiler/test/cmdlineTests/too_long_line_edge_out/input.sol delete mode 100644 compiler/test/cmdlineTests/too_long_line_left_short/err delete mode 100644 compiler/test/cmdlineTests/too_long_line_left_short/exit delete mode 100644 compiler/test/cmdlineTests/too_long_line_left_short/input.sol delete mode 100644 compiler/test/cmdlineTests/too_long_line_multiline/err delete mode 100644 compiler/test/cmdlineTests/too_long_line_multiline/exit delete mode 100644 compiler/test/cmdlineTests/too_long_line_multiline/input.sol delete mode 100644 compiler/test/cmdlineTests/too_long_line_right_short/err delete mode 100644 compiler/test/cmdlineTests/too_long_line_right_short/exit delete mode 100644 compiler/test/cmdlineTests/too_long_line_right_short/input.sol delete mode 100644 compiler/test/cmdlineTests/yul_stack_opt/args delete mode 100644 compiler/test/cmdlineTests/yul_stack_opt/err delete mode 100644 compiler/test/cmdlineTests/yul_stack_opt/input.sol delete mode 100644 compiler/test/cmdlineTests/yul_stack_opt/output delete mode 100644 compiler/test/cmdlineTests/yul_stack_opt_disabled/args delete mode 100644 compiler/test/cmdlineTests/yul_stack_opt_disabled/err delete mode 100644 compiler/test/cmdlineTests/yul_stack_opt_disabled/exit delete mode 100644 compiler/test/cmdlineTests/yul_stack_opt_disabled/input.sol delete mode 100644 compiler/test/cmdlineTests/yul_stack_opt_disabled/output delete mode 100644 compiler/test/cmdlineTests/yul_string_format_ascii/input.json delete mode 100644 compiler/test/cmdlineTests/yul_string_format_ascii/output.json delete mode 100644 compiler/test/cmdlineTests/yul_string_format_ascii_bytes32/input.json delete mode 100644 compiler/test/cmdlineTests/yul_string_format_ascii_bytes32/output.json delete mode 100644 compiler/test/cmdlineTests/yul_string_format_ascii_bytes32_from_number/input.json delete mode 100644 compiler/test/cmdlineTests/yul_string_format_ascii_bytes32_from_number/output.json delete mode 100644 compiler/test/cmdlineTests/yul_string_format_ascii_long/input.json delete mode 100644 compiler/test/cmdlineTests/yul_string_format_ascii_long/output.json delete mode 100644 compiler/test/cmdlineTests/yul_string_format_hex/input.json delete mode 100644 compiler/test/cmdlineTests/yul_string_format_hex/output.json delete mode 100644 compiler/test/compilationTests/MultiSigWallet/Factory.sol delete mode 100644 compiler/test/compilationTests/MultiSigWallet/LICENSE delete mode 100644 compiler/test/compilationTests/MultiSigWallet/MultiSigWallet.sol delete mode 100644 compiler/test/compilationTests/MultiSigWallet/MultiSigWalletFactory.sol delete mode 100644 compiler/test/compilationTests/MultiSigWallet/MultiSigWalletWithDailyLimit.sol delete mode 100644 compiler/test/compilationTests/MultiSigWallet/MultiSigWalletWithDailyLimitFactory.sol delete mode 100644 compiler/test/compilationTests/MultiSigWallet/README.md delete mode 100644 compiler/test/compilationTests/MultiSigWallet/TestToken.sol delete mode 100644 compiler/test/compilationTests/README.md delete mode 100644 compiler/test/compilationTests/corion/LICENSE delete mode 100644 compiler/test/compilationTests/corion/README.md delete mode 100644 compiler/test/compilationTests/corion/announcementTypes.sol delete mode 100644 compiler/test/compilationTests/corion/ico.sol delete mode 100644 compiler/test/compilationTests/corion/module.sol delete mode 100644 compiler/test/compilationTests/corion/moduleHandler.sol delete mode 100644 compiler/test/compilationTests/corion/multiOwner.sol delete mode 100644 compiler/test/compilationTests/corion/owned.sol delete mode 100644 compiler/test/compilationTests/corion/premium.sol delete mode 100644 compiler/test/compilationTests/corion/provider.sol delete mode 100644 compiler/test/compilationTests/corion/publisher.sol delete mode 100644 compiler/test/compilationTests/corion/safeMath.sol delete mode 100644 compiler/test/compilationTests/corion/schelling.sol delete mode 100644 compiler/test/compilationTests/corion/token.sol delete mode 100644 compiler/test/compilationTests/corion/tokenDB.sol delete mode 100644 compiler/test/compilationTests/gnosis/Events/CategoricalEvent.sol delete mode 100644 compiler/test/compilationTests/gnosis/Events/Event.sol delete mode 100644 compiler/test/compilationTests/gnosis/Events/EventFactory.sol delete mode 100644 compiler/test/compilationTests/gnosis/Events/ScalarEvent.sol delete mode 100644 compiler/test/compilationTests/gnosis/LICENSE delete mode 100644 compiler/test/compilationTests/gnosis/MarketMakers/LMSRMarketMaker.sol delete mode 100644 compiler/test/compilationTests/gnosis/MarketMakers/MarketMaker.sol delete mode 100644 compiler/test/compilationTests/gnosis/Markets/Campaign.sol delete mode 100644 compiler/test/compilationTests/gnosis/Markets/CampaignFactory.sol delete mode 100644 compiler/test/compilationTests/gnosis/Markets/Market.sol delete mode 100644 compiler/test/compilationTests/gnosis/Markets/MarketFactory.sol delete mode 100644 compiler/test/compilationTests/gnosis/Markets/StandardMarket.sol delete mode 100644 compiler/test/compilationTests/gnosis/Markets/StandardMarketFactory.sol delete mode 100644 compiler/test/compilationTests/gnosis/Migrations.sol delete mode 100644 compiler/test/compilationTests/gnosis/Oracles/CentralizedOracle.sol delete mode 100644 compiler/test/compilationTests/gnosis/Oracles/CentralizedOracleFactory.sol delete mode 100644 compiler/test/compilationTests/gnosis/Oracles/DifficultyOracle.sol delete mode 100644 compiler/test/compilationTests/gnosis/Oracles/DifficultyOracleFactory.sol delete mode 100644 compiler/test/compilationTests/gnosis/Oracles/FutarchyOracle.sol delete mode 100644 compiler/test/compilationTests/gnosis/Oracles/FutarchyOracleFactory.sol delete mode 100644 compiler/test/compilationTests/gnosis/Oracles/MajorityOracle.sol delete mode 100644 compiler/test/compilationTests/gnosis/Oracles/MajorityOracleFactory.sol delete mode 100644 compiler/test/compilationTests/gnosis/Oracles/Oracle.sol delete mode 100644 compiler/test/compilationTests/gnosis/Oracles/SignedMessageOracle.sol delete mode 100644 compiler/test/compilationTests/gnosis/Oracles/SignedMessageOracleFactory.sol delete mode 100644 compiler/test/compilationTests/gnosis/Oracles/UltimateOracle.sol delete mode 100644 compiler/test/compilationTests/gnosis/Oracles/UltimateOracleFactory.sol delete mode 100644 compiler/test/compilationTests/gnosis/README.md delete mode 100644 compiler/test/compilationTests/gnosis/Tokens/EtherToken.sol delete mode 100644 compiler/test/compilationTests/gnosis/Tokens/OutcomeToken.sol delete mode 100644 compiler/test/compilationTests/gnosis/Tokens/StandardToken.sol delete mode 100644 compiler/test/compilationTests/gnosis/Tokens/Token.sol delete mode 100644 compiler/test/compilationTests/gnosis/Utils/Math.sol delete mode 100644 compiler/test/compilationTests/milestonetracker/LICENSE delete mode 100644 compiler/test/compilationTests/milestonetracker/MilestoneTracker.sol delete mode 100644 compiler/test/compilationTests/milestonetracker/README.md delete mode 100644 compiler/test/compilationTests/milestonetracker/RLP.sol delete mode 100644 compiler/test/compilationTests/stringutils/LICENSE delete mode 100644 compiler/test/compilationTests/stringutils/README.md delete mode 100644 compiler/test/compilationTests/stringutils/strings.sol delete mode 100644 compiler/test/contracts/AuctionRegistrar.cpp delete mode 100644 compiler/test/contracts/ContractInterface.h delete mode 100644 compiler/test/contracts/FixedFeeRegistrar.cpp delete mode 100644 compiler/test/contracts/Wallet.cpp delete mode 100755 compiler/test/docsCodeStyle.sh delete mode 100644 compiler/test/evmc/CMakeLists.txt delete mode 100644 compiler/test/evmc/LICENSE delete mode 100644 compiler/test/evmc/README.md delete mode 100644 compiler/test/evmc/evmc.h delete mode 100644 compiler/test/evmc/evmc.hpp delete mode 100644 compiler/test/evmc/helpers.h delete mode 100644 compiler/test/evmc/loader.c delete mode 100644 compiler/test/evmc/loader.h delete mode 100644 compiler/test/evmc/mocked_host.hpp delete mode 100644 compiler/test/evmc/utils.h delete mode 100755 compiler/test/externalTests.sh delete mode 100755 compiler/test/externalTests/colony.sh delete mode 100644 compiler/test/externalTests/common.sh delete mode 100755 compiler/test/externalTests/gnosis.sh delete mode 100644 compiler/test/externalTests/solc-js/DAO/DAO.sol delete mode 100644 compiler/test/externalTests/solc-js/DAO/ManagedAccount.sol delete mode 100644 compiler/test/externalTests/solc-js/DAO/Token.sol delete mode 100644 compiler/test/externalTests/solc-js/DAO/TokenCreation.sol delete mode 100644 compiler/test/externalTests/solc-js/determinism.js delete mode 100755 compiler/test/externalTests/solc-js/solc-js.sh delete mode 100755 compiler/test/externalTests/zeppelin.sh delete mode 100644 compiler/test/formal/README.md delete mode 100644 compiler/test/formal/checked_int_add.py delete mode 100644 compiler/test/formal/checked_int_div.py delete mode 100644 compiler/test/formal/checked_int_mul_16.py delete mode 100644 compiler/test/formal/checked_int_sub.py delete mode 100644 compiler/test/formal/checked_uint_add.py delete mode 100644 compiler/test/formal/checked_uint_mul_16.py delete mode 100644 compiler/test/formal/checked_uint_sub.py delete mode 100644 compiler/test/formal/combine_div_shl_one_32.py delete mode 100644 compiler/test/formal/combine_mul_shl_one_64.py delete mode 100644 compiler/test/formal/combine_shl_shr_by_constant_64.py delete mode 100644 compiler/test/formal/combine_shr_shl_by_constant_64.py delete mode 100644 compiler/test/formal/move_and_across_shl_128.py delete mode 100644 compiler/test/formal/move_and_across_shr_128.py delete mode 100644 compiler/test/formal/opcodes.py delete mode 100644 compiler/test/formal/rule.py delete mode 100644 compiler/test/formal/shl_workaround_8.py delete mode 100644 compiler/test/formal/sub_not_zero_x_to_not_x_256.py delete mode 100644 compiler/test/formal/util.py delete mode 100644 compiler/test/libevmasm/Assembler.cpp delete mode 100644 compiler/test/libevmasm/Optimiser.cpp delete mode 100644 compiler/test/liblangutil/CharStream.cpp delete mode 100644 compiler/test/liblangutil/SourceLocation.cpp delete mode 100644 compiler/test/libsolidity/ABIDecoderTests.cpp delete mode 100644 compiler/test/libsolidity/ABIEncoderTests.cpp delete mode 100644 compiler/test/libsolidity/ABIJson/basic_test.sol delete mode 100644 compiler/test/libsolidity/ABIJson/constructor_abi.sol delete mode 100644 compiler/test/libsolidity/ABIJson/empty_contract.sol delete mode 100644 compiler/test/libsolidity/ABIJson/empty_name_input_parameter_with_named_one.sol delete mode 100644 compiler/test/libsolidity/ABIJson/empty_name_return_parameters.sol delete mode 100644 compiler/test/libsolidity/ABIJson/event_structs.sol delete mode 100644 compiler/test/libsolidity/ABIJson/events.sol delete mode 100644 compiler/test/libsolidity/ABIJson/events_anonymous.sol delete mode 100644 compiler/test/libsolidity/ABIJson/function_type.sol delete mode 100644 compiler/test/libsolidity/ABIJson/function_type_extended.sol delete mode 100644 compiler/test/libsolidity/ABIJson/global_struct.sol delete mode 100644 compiler/test/libsolidity/ABIJson/include_fallback_function.sol delete mode 100644 compiler/test/libsolidity/ABIJson/inherited.sol delete mode 100644 compiler/test/libsolidity/ABIJson/library_function.sol delete mode 100644 compiler/test/libsolidity/ABIJson/multiple_methods.sol delete mode 100644 compiler/test/libsolidity/ABIJson/multiple_methods_order.sol delete mode 100644 compiler/test/libsolidity/ABIJson/multiple_params.sol delete mode 100644 compiler/test/libsolidity/ABIJson/payable_constructor_abi.sol delete mode 100644 compiler/test/libsolidity/ABIJson/payable_fallback_function.sol delete mode 100644 compiler/test/libsolidity/ABIJson/payable_function.sol delete mode 100644 compiler/test/libsolidity/ABIJson/pure_function.sol delete mode 100644 compiler/test/libsolidity/ABIJson/receive_ether_and_fallback_function.sol delete mode 100644 compiler/test/libsolidity/ABIJson/receive_ether_function.sol delete mode 100644 compiler/test/libsolidity/ABIJson/return_param_in_abi.sol delete mode 100644 compiler/test/libsolidity/ABIJson/return_structs.sol delete mode 100644 compiler/test/libsolidity/ABIJson/return_structs_with_contracts.sol delete mode 100644 compiler/test/libsolidity/ABIJson/structs_and_arrays.sol delete mode 100644 compiler/test/libsolidity/ABIJson/structs_in_libraries.sol delete mode 100644 compiler/test/libsolidity/ABIJson/view_function.sol delete mode 100644 compiler/test/libsolidity/ABIJsonTest.cpp delete mode 100644 compiler/test/libsolidity/ABIJsonTest.h delete mode 100644 compiler/test/libsolidity/ASTJSON/abstract_contract.json delete mode 100644 compiler/test/libsolidity/ASTJSON/abstract_contract.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/abstract_contract_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/address_payable.json delete mode 100644 compiler/test/libsolidity/ASTJSON/address_payable.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/address_payable_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/array_type_name.json delete mode 100644 compiler/test/libsolidity/ASTJSON/array_type_name.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/array_type_name_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/call.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/call.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/call_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/function.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/function.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/function_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/leave.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/leave.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/leave_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/loop.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/loop.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/loop_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/nested_functions.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/nested_functions.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/nested_functions_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/slot_offset.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/slot_offset.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/slot_offset_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/stringlit.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/stringlit.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/stringlit_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/switch.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/switch.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/switch_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/var_access.json delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/var_access.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/assembly/var_access_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/constructor.json delete mode 100644 compiler/test/libsolidity/ASTJSON/constructor.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/constructor_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/contract_dep_order.json delete mode 100644 compiler/test/libsolidity/ASTJSON/contract_dep_order.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/contract_dep_order_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/documentation.json delete mode 100644 compiler/test/libsolidity/ASTJSON/documentation.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/documentation_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/enum_value.json delete mode 100644 compiler/test/libsolidity/ASTJSON/enum_value.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/enum_value_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/event_definition.json delete mode 100644 compiler/test/libsolidity/ASTJSON/event_definition.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/event_definition_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/fallback.json delete mode 100644 compiler/test/libsolidity/ASTJSON/fallback.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/fallback_and_reveice_ether.json delete mode 100644 compiler/test/libsolidity/ASTJSON/fallback_and_reveice_ether.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/fallback_and_reveice_ether_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/fallback_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/fallback_payable.json delete mode 100644 compiler/test/libsolidity/ASTJSON/fallback_payable.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/fallback_payable_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/function_type.json delete mode 100644 compiler/test/libsolidity/ASTJSON/function_type.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/function_type_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/global_enum.json delete mode 100644 compiler/test/libsolidity/ASTJSON/global_enum.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/global_enum_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/global_struct.json delete mode 100644 compiler/test/libsolidity/ASTJSON/global_struct.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/global_struct_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/inheritance_specifier.json delete mode 100644 compiler/test/libsolidity/ASTJSON/inheritance_specifier.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/inheritance_specifier_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/long_type_name_binary_operation.json delete mode 100644 compiler/test/libsolidity/ASTJSON/long_type_name_binary_operation.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/long_type_name_identifier.json delete mode 100644 compiler/test/libsolidity/ASTJSON/long_type_name_identifier.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/mappings.json delete mode 100644 compiler/test/libsolidity/ASTJSON/mappings.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/mappings_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/modifier_definition.json delete mode 100644 compiler/test/libsolidity/ASTJSON/modifier_definition.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/modifier_definition_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/modifier_invocation.json delete mode 100644 compiler/test/libsolidity/ASTJSON/modifier_invocation.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/modifier_invocation_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/non_utf8.json delete mode 100644 compiler/test/libsolidity/ASTJSON/non_utf8.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/non_utf8_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/override.json delete mode 100644 compiler/test/libsolidity/ASTJSON/override.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/override_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/placeholder_statement.json delete mode 100644 compiler/test/libsolidity/ASTJSON/placeholder_statement.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/placeholder_statement_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/receive_ether.json delete mode 100644 compiler/test/libsolidity/ASTJSON/receive_ether.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/receive_ether_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/short_type_name.json delete mode 100644 compiler/test/libsolidity/ASTJSON/short_type_name.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/short_type_name_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/short_type_name_ref.json delete mode 100644 compiler/test/libsolidity/ASTJSON/short_type_name_ref.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/short_type_name_ref_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/smoke.json delete mode 100644 compiler/test/libsolidity/ASTJSON/smoke.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/smoke_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/source_location.json delete mode 100644 compiler/test/libsolidity/ASTJSON/source_location.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/source_location_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/two_base_functions.json delete mode 100644 compiler/test/libsolidity/ASTJSON/two_base_functions.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/two_base_functions_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSON/using_for_directive.json delete mode 100644 compiler/test/libsolidity/ASTJSON/using_for_directive.sol delete mode 100644 compiler/test/libsolidity/ASTJSON/using_for_directive_legacy.json delete mode 100644 compiler/test/libsolidity/ASTJSONTest.cpp delete mode 100644 compiler/test/libsolidity/ASTJSONTest.h delete mode 100644 compiler/test/libsolidity/AnalysisFramework.cpp delete mode 100644 compiler/test/libsolidity/AnalysisFramework.h delete mode 100644 compiler/test/libsolidity/Assembly.cpp delete mode 100644 compiler/test/libsolidity/ErrorCheck.cpp delete mode 100644 compiler/test/libsolidity/GasCosts.cpp delete mode 100644 compiler/test/libsolidity/GasMeter.cpp delete mode 100644 compiler/test/libsolidity/GasTest.cpp delete mode 100644 compiler/test/libsolidity/GasTest.h delete mode 100644 compiler/test/libsolidity/Imports.cpp delete mode 100644 compiler/test/libsolidity/InlineAssembly.cpp delete mode 100644 compiler/test/libsolidity/LibSolc.cpp delete mode 100644 compiler/test/libsolidity/Metadata.cpp delete mode 100644 compiler/test/libsolidity/SMTChecker.cpp delete mode 100644 compiler/test/libsolidity/SMTCheckerJSONTest.cpp delete mode 100644 compiler/test/libsolidity/SMTCheckerJSONTest.h delete mode 100644 compiler/test/libsolidity/SMTCheckerTest.cpp delete mode 100644 compiler/test/libsolidity/SMTCheckerTest.h delete mode 100644 compiler/test/libsolidity/SemVerMatcher.cpp delete mode 100644 compiler/test/libsolidity/SemanticTest.cpp delete mode 100644 compiler/test/libsolidity/SemanticTest.h delete mode 100644 compiler/test/libsolidity/SolidityCompiler.cpp delete mode 100644 compiler/test/libsolidity/SolidityEndToEndTest.cpp delete mode 100644 compiler/test/libsolidity/SolidityExecutionFramework.cpp delete mode 100644 compiler/test/libsolidity/SolidityExecutionFramework.h delete mode 100644 compiler/test/libsolidity/SolidityExpressionCompiler.cpp delete mode 100644 compiler/test/libsolidity/SolidityNameAndTypeResolution.cpp delete mode 100644 compiler/test/libsolidity/SolidityNatspecJSON.cpp delete mode 100644 compiler/test/libsolidity/SolidityOptimizer.cpp delete mode 100644 compiler/test/libsolidity/SolidityParser.cpp delete mode 100644 compiler/test/libsolidity/SolidityScanner.cpp delete mode 100644 compiler/test/libsolidity/SolidityTypes.cpp delete mode 100644 compiler/test/libsolidity/StandardCompiler.cpp delete mode 100644 compiler/test/libsolidity/SyntaxTest.cpp delete mode 100644 compiler/test/libsolidity/SyntaxTest.h delete mode 100644 compiler/test/libsolidity/ViewPureChecker.cpp delete mode 100644 compiler/test/libsolidity/errorRecoveryTests/constructor_recovers.sol delete mode 100644 compiler/test/libsolidity/errorRecoveryTests/contract_recovery.sol delete mode 100644 compiler/test/libsolidity/errorRecoveryTests/do_not_delete_at_error.sol delete mode 100644 compiler/test/libsolidity/errorRecoveryTests/error_to_eos.sol delete mode 100644 compiler/test/libsolidity/errorRecoveryTests/missing_rhs.sol delete mode 100644 compiler/test/libsolidity/errorRecoveryTests/multiple_errors.sol delete mode 100644 compiler/test/libsolidity/gasTests/abiv2.sol delete mode 100644 compiler/test/libsolidity/gasTests/abiv2_optimised.sol delete mode 100644 compiler/test/libsolidity/gasTests/data_storage.sol delete mode 100644 compiler/test/libsolidity/gasTests/dispatch_large.sol delete mode 100644 compiler/test/libsolidity/gasTests/dispatch_large_optimised.sol delete mode 100644 compiler/test/libsolidity/gasTests/dispatch_medium.sol delete mode 100644 compiler/test/libsolidity/gasTests/dispatch_medium_optimised.sol delete mode 100644 compiler/test/libsolidity/gasTests/dispatch_small.sol delete mode 100644 compiler/test/libsolidity/gasTests/dispatch_small_optimised.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiDecodeV1/decode_slice.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiDecodeV1/dynamic_memory_copy.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_dynamic.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_dynamic_index_access.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_dynamic_static_dynamic.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_dynamic_static_short_decode.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_dynamic_static_short_reencode.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_function_types.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_multi_dynamic.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_static.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_static_dynamic_static.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_static_index_access.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_struct_dynamic.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_two_dynamic.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_two_static.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_struct_dynamic.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_struct_member_offset.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/calldata_struct_simple.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/cleanup/address.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/cleanup/bool.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/cleanup/bytesx.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/cleanup/dynamic_array.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/cleanup/function.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/cleanup/intx.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/cleanup/simple_struct.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/cleanup/static_array.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/cleanup/uintx.sol delete mode 100644 compiler/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol delete mode 100644 compiler/test/libsolidity/semanticTests/array/calldata_slice_access.sol delete mode 100644 compiler/test/libsolidity/semanticTests/array/push_no_args_1d.sol delete mode 100644 compiler/test/libsolidity/semanticTests/array/push_no_args_2d.sol delete mode 100644 compiler/test/libsolidity/semanticTests/array/push_no_args_bytes.sol delete mode 100644 compiler/test/libsolidity/semanticTests/array/push_no_args_struct.sol delete mode 100644 compiler/test/libsolidity/semanticTests/asmForLoop/for_loop_break.sol delete mode 100644 compiler/test/libsolidity/semanticTests/asmForLoop/for_loop_continue.sol delete mode 100644 compiler/test/libsolidity/semanticTests/asmForLoop/for_loop_nested.sol delete mode 100644 compiler/test/libsolidity/semanticTests/builtinFunctions/blockhash_shadow_resolution.sol delete mode 100644 compiler/test/libsolidity/semanticTests/c99_scoping_activation.sol delete mode 100644 compiler/test/libsolidity/semanticTests/ecrecover/ecrecover.sol delete mode 100644 compiler/test/libsolidity/semanticTests/ecrecover/ecrecover_abiV2.sol delete mode 100644 compiler/test/libsolidity/semanticTests/ecrecover/failing_ecrecover_invalid_input.sol delete mode 100644 compiler/test/libsolidity/semanticTests/ecrecover/failing_ecrecover_invalid_input_asm.sol delete mode 100644 compiler/test/libsolidity/semanticTests/ecrecover/failing_ecrecover_invalid_input_proper.sol delete mode 100644 compiler/test/libsolidity/semanticTests/empty_contract.sol delete mode 100644 compiler/test/libsolidity/semanticTests/exponentiation/signed_base.sol delete mode 100644 compiler/test/libsolidity/semanticTests/exponentiation/small_exp.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/bytes_comparison.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/conditional_expression_different_types.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/conditional_expression_false_literal.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/conditional_expression_functions.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/conditional_expression_multiple.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/conditional_expression_storage_memory_1.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/conditional_expression_storage_memory_2.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/conditional_expression_true_literal.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/conditional_expression_tuples.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/conditional_expression_with_return_values.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/exp_operator_const.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/exp_operator_const_signed.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/exp_zero_literal.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/inc_dec_operators.sol delete mode 100644 compiler/test/libsolidity/semanticTests/expressions/uncalled_address_transfer_send.sol delete mode 100644 compiler/test/libsolidity/semanticTests/fallback/fallback_or_receive.sol delete mode 100644 compiler/test/libsolidity/semanticTests/fallback/inherited.sol delete mode 100644 compiler/test/libsolidity/semanticTests/fallback/short_data_calls_fallback.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionCall/array_multiple_local_vars.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionCall/base_base_overload.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionCall/base_overload.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionCall/disordered_named_args.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionCall/mapping_internal_argument.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionCall/mapping_internal_return.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionCall/member_accessors.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionCall/multiple_functions.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionCall/multiple_return_values.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionCall/named_args.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionCall/named_args_overload.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionCall/transaction_status.sol delete mode 100644 compiler/test/libsolidity/semanticTests/functionSelector/function_selector_via_contract_name.sol delete mode 100644 compiler/test/libsolidity/semanticTests/inlineAssembly/chainid.sol delete mode 100644 compiler/test/libsolidity/semanticTests/inlineAssembly/constant_access.sol delete mode 100644 compiler/test/libsolidity/semanticTests/inlineAssembly/constant_access_referencing.sol delete mode 100644 compiler/test/libsolidity/semanticTests/inlineAssembly/leave.sol delete mode 100644 compiler/test/libsolidity/semanticTests/inlineAssembly/selfbalance.sol delete mode 100644 compiler/test/libsolidity/semanticTests/inlineAssembly/truefalse.sol delete mode 100644 compiler/test/libsolidity/semanticTests/interface_inheritance_conversions.sol delete mode 100644 compiler/test/libsolidity/semanticTests/libraries/library_address.sol delete mode 100644 compiler/test/libsolidity/semanticTests/libraries/library_address_homestead.sol delete mode 100644 compiler/test/libsolidity/semanticTests/libraries/library_delegatecall_guard_pure.sol delete mode 100644 compiler/test/libsolidity/semanticTests/libraries/library_delegatecall_guard_view_needed.sol delete mode 100644 compiler/test/libsolidity/semanticTests/libraries/library_delegatecall_guard_view_not_needed.sol delete mode 100644 compiler/test/libsolidity/semanticTests/libraries/library_delegatecall_guard_view_staticcall.sol delete mode 100644 compiler/test/libsolidity/semanticTests/libraries/library_function_selectors.sol delete mode 100644 compiler/test/libsolidity/semanticTests/libraries/library_function_selectors_struct.sol delete mode 100644 compiler/test/libsolidity/semanticTests/libraries/stub.sol delete mode 100644 compiler/test/libsolidity/semanticTests/libraries/stub_internal.sol delete mode 100644 compiler/test/libsolidity/semanticTests/literals/hex_string_with_underscore.sol delete mode 100644 compiler/test/libsolidity/semanticTests/receive/empty_calldata_calls_receive.sol delete mode 100644 compiler/test/libsolidity/semanticTests/receive/ether_and_data.sol delete mode 100644 compiler/test/libsolidity/semanticTests/receive/inherited.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/array_slices.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/bubble.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/calldata_array_dynamic_invalid.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/calldata_array_dynamic_static_short_decode.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/calldata_array_dynamic_static_short_reencode.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/calldata_array_invalid_length.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/calldata_arrays_too_large.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/calldata_too_short.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/called_contract_has_code.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/enum.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/ether_non_payable_function.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/function_entry_checks.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/invalid_abi_decoding_calldata_v1.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/invalid_abi_decoding_memory_v1.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/library_non_view_call.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/short_input_array.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/short_input_bytes.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/transfer.sol delete mode 100644 compiler/test/libsolidity/semanticTests/revertStrings/unknown_sig_no_fallback.sol delete mode 100644 compiler/test/libsolidity/semanticTests/salted_create/salted_create.sol delete mode 100644 compiler/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol delete mode 100644 compiler/test/libsolidity/semanticTests/shifts.sol delete mode 100644 compiler/test/libsolidity/semanticTests/smoke/alignment.sol delete mode 100644 compiler/test/libsolidity/semanticTests/smoke/arrays.sol delete mode 100644 compiler/test/libsolidity/semanticTests/smoke/basic.sol delete mode 100644 compiler/test/libsolidity/semanticTests/smoke/bytes_and_strings.sol delete mode 100644 compiler/test/libsolidity/semanticTests/smoke/constructor.sol delete mode 100644 compiler/test/libsolidity/semanticTests/smoke/failure.sol delete mode 100644 compiler/test/libsolidity/semanticTests/smoke/fallback.sol delete mode 100644 compiler/test/libsolidity/semanticTests/smoke/multiline.sol delete mode 100644 compiler/test/libsolidity/semanticTests/smoke/multiline_comments.sol delete mode 100644 compiler/test/libsolidity/semanticTests/smoke/structs.sol delete mode 100644 compiler/test/libsolidity/semanticTests/snark.sol delete mode 100644 compiler/test/libsolidity/semanticTests/specialFunctions/abi_functions_member_access.sol delete mode 100644 compiler/test/libsolidity/semanticTests/state_var_initialization.sol delete mode 100644 compiler/test/libsolidity/semanticTests/statements/do_while_loop_continue.sol delete mode 100644 compiler/test/libsolidity/semanticTests/storage/accessors_mapping_for_array.sol delete mode 100644 compiler/test/libsolidity/semanticTests/storage/array_accessor.sol delete mode 100644 compiler/test/libsolidity/semanticTests/storage/chop_sign_bits.sol delete mode 100644 compiler/test/libsolidity/semanticTests/storage/complex_accessors.sol delete mode 100644 compiler/test/libsolidity/semanticTests/storage/mappings_array2d_pop_delete.sol delete mode 100644 compiler/test/libsolidity/semanticTests/storage/mappings_array_pop_delete.sol delete mode 100644 compiler/test/libsolidity/semanticTests/storage/simple_accessor.sol delete mode 100644 compiler/test/libsolidity/semanticTests/storage/state_smoke_test.sol delete mode 100644 compiler/test/libsolidity/semanticTests/storage/struct_accessor.sol delete mode 100644 compiler/test/libsolidity/semanticTests/structs/array_of_recursive_struct.sol delete mode 100644 compiler/test/libsolidity/semanticTests/structs/calldata/dynamic_nested.sol delete mode 100644 compiler/test/libsolidity/semanticTests/structs/calldata/dynamically_encoded.sol delete mode 100644 compiler/test/libsolidity/semanticTests/structs/conversion/assignment_ignore_mapping.sol delete mode 100644 compiler/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol delete mode 100644 compiler/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory_complex.sol delete mode 100644 compiler/test/libsolidity/semanticTests/structs/delete_struct.sol delete mode 100644 compiler/test/libsolidity/semanticTests/structs/global.sol delete mode 100644 compiler/test/libsolidity/semanticTests/structs/struct_reference.sol delete mode 100644 compiler/test/libsolidity/semanticTests/structs/structs.sol delete mode 100644 compiler/test/libsolidity/semanticTests/tryCatch/assert.sol delete mode 100644 compiler/test/libsolidity/semanticTests/tryCatch/create.sol delete mode 100644 compiler/test/libsolidity/semanticTests/tryCatch/invalid_error_encoding.sol delete mode 100644 compiler/test/libsolidity/semanticTests/tryCatch/lowLevel.sol delete mode 100644 compiler/test/libsolidity/semanticTests/tryCatch/nested.sol delete mode 100644 compiler/test/libsolidity/semanticTests/tryCatch/return_function.sol delete mode 100644 compiler/test/libsolidity/semanticTests/tryCatch/simple.sol delete mode 100644 compiler/test/libsolidity/semanticTests/tryCatch/structured.sol delete mode 100644 compiler/test/libsolidity/semanticTests/tryCatch/structuredAndLowLevel.sol delete mode 100644 compiler/test/libsolidity/semanticTests/tryCatch/trivial.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/assign_calldata_value_type.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_greater_size.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_same_size.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_smaller_size.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_greater_size.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_same_min_size.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_same_type.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_smaller_size.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_greater_size.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_same_min_size.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_same_size.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_smaller_size.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/external_function_to_address.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/mapping_contract_key.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/mapping_contract_key_getter.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/mapping_contract_key_library.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/mapping_enum_key.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/mapping_enum_key_getter.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/mapping_enum_key_getter_v2.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/mapping_enum_key_library.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/mapping_simple.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/packing_signed_types.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/packing_unpacking_types.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/strings.sol delete mode 100644 compiler/test/libsolidity/semanticTests/types/type_conversion_cleanup.sol delete mode 100644 compiler/test/libsolidity/semanticTests/uninitializedFunctionPointer/invalidInConstructor.sol delete mode 100644 compiler/test/libsolidity/semanticTests/uninitializedFunctionPointer/invalidStoredInConstructor.sol delete mode 100644 compiler/test/libsolidity/semanticTests/uninitializedFunctionPointer/store2.sol delete mode 100644 compiler/test/libsolidity/semanticTests/uninitializedFunctionPointer/storeInConstructor.sol delete mode 100644 compiler/test/libsolidity/semanticTests/variables/delete_local.sol delete mode 100644 compiler/test/libsolidity/semanticTests/variables/delete_locals.sol delete mode 100644 compiler/test/libsolidity/semanticTests/variables/mapping_local_assignment.sol delete mode 100644 compiler/test/libsolidity/semanticTests/variables/mapping_local_compound_assignment.sol delete mode 100644 compiler/test/libsolidity/semanticTests/variables/mapping_local_tuple_assignment.sol delete mode 100644 compiler/test/libsolidity/semanticTests/variables/public_state_overridding.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/array_memory_as_parameter.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/array_memory_create.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/array_memory_index_access.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/array_push_return_reference.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/array_push_with_arg.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/array_storage_index_access.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/array_storage_index_boundary_test.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/array_storage_index_zeroed_test.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/array_storage_length_access.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/array_storage_pop_zero_length.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/array_storage_push_empty_length_address.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/array_storage_push_pop.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/assert.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/assert_and_require.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/comparison.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/comparison_functions.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_assignment.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_function_call.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_local_assignment.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_assignment.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_function_call.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_local_assignment.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/delete.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/detect_add_overflow.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/detect_add_overflow_signed.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/detect_div_overflow.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/detect_mod_zero.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/detect_mod_zero_signed.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/detect_mul_overflow.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/detect_mul_overflow_signed.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/detect_sub_overflow.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/detect_sub_overflow_signed.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/erc20.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/function_entry_checks.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/if.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/keccak.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/local_address_assignment.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/local_assignment.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/local_bool_assignment.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/loops/break.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/loops/continue.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/loops/return.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/loops/simple.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/mapping_enum_key_getter.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/mapping_getters.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/msg_sender.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/require.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/return.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/return_and_convert.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/short_circuit.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/simple_assignment.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/simple_inline_asm.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/smoke_test.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/storage/mappings.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/storage/packed_storage.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/storage/simple_storage.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/string_format.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/string_literals.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/unary_operations.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/various_inline_asm.sol delete mode 100644 compiler/test/libsolidity/semanticTests/viaYul/virtual_functions.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/complex/MerkleProof.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/complex/slither/const_state_variables.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/complex/slither/data_dependency.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/complex/slither/external_function.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/complex/warn_on_struct.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/complex/warn_on_typecast.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/assignment_in_declaration.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/branches_assert_condition_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/branches_assert_condition_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_4.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_5.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_6.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_4.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_else_branch.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_modifier_branch.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_placeholder_inside_modifier_branch.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_inside_branch.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_need_both.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_need_both_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_touched.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_touched_function.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_inside_branch.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_need_both.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_need_both_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_touched.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_touched_function.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/ways_to_merge_variables_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/ways_to_merge_variables_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/control_flow/ways_to_merge_variables_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/abi_encode_functions.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_base_basic.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_4.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_empty_middle.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_empty_middle_empty_base.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_empty_chain.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_empty_middle.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_empty_middle_no_invocation.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_empty_base.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_local_vars.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_modifier.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_same_var.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_simple.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_state_value.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_state_value_inherited.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_state_value_parameter.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/constructor_this.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/function_call_does_not_clear_local_vars.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/function_call_state_var_init.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/function_inline_chain.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_bound_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_bound_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_external_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_external_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_external_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_external_4.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_identity_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_identity_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_identity_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_identity_2_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_identity_as_tuple.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_identity_as_tuple_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_library_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_library_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_recursive.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_recursive_indirect.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_storage_var_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_storage_var_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_storage_var_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_storage_var_2_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_trivial_condition_for.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_trivial_condition_for_only_call.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_trivial_condition_if.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_trivial_condition_require.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_trivial_condition_require_only_call.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_trivial_condition_while.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/functions_trivial_condition_while_only_call.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/recursive_multi_return.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/recursive_multi_return_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/this_external_call.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/this_external_call_return.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/this_fake.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/functions/this_state.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_mixed_chain_with_params.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_base.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_alternate.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_diamond.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_diamond_middle.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_function_call.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/fallback.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/fallback_receive.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/functions_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/functions_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/functions_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/implicit_constructor_hierarchy.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/implicit_only_constructor_hierarchy.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/receive.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/receive_fallback.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/state_variables.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/state_variables_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inheritance/state_variables_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inline_assembly/empty.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/inline_assembly/local_var.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/invariants/loop_basic.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/invariants/loop_basic_for.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/invariants/loop_nested.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/invariants/loop_nested_for.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/invariants/state_machine_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/invariants/state_machine_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/do_while_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/do_while_1_false_positives.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/do_while_break.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/do_while_break_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/do_while_break_2_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/do_while_break_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/do_while_continue.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_1_break.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_1_break_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_1_continue.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_1_continue_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_1_false_positive.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_break_direct.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_4.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_5.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_6.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_memory_memory.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_memory_storage.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_storage_memory.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_storage_storage.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/for_loop_unreachable_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_1_break.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_1_break_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_1_continue.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_1_continue_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_1_infinite.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_2_break.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_2_break_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_2_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_break_direct.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_memory_memory.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_memory_storage.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_storage_storage.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_loop_simple_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_loop_simple_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_loop_simple_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_loop_simple_4.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_loop_simple_5.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_nested_break.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_nested_break_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_nested_continue.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/loops/while_nested_continue_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_assignment_outside_branch.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_code_after_placeholder.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_control_flow.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_inline_function_inside_branch.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_inside_branch.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_inside_branch_assignment.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_inside_branch_assignment_branch.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_inside_branch_assignment_multi_branches.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_multi.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_functions.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_functions_recursive.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_parameters.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_overflow.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_parameter_copy.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_parameters.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_return.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_same_local_variables.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_simple.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_two_invocations.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/modifiers/modifier_two_placeholders.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_add.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_add_array_index.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_add_chain.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_add_mapping.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_bitwise_and_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_bitwise_xor_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_mul.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_mul_array_index.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_mul_mapping.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_shl_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_shr_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_sub.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_sub_array_index.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/compound_sub_mapping.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/delete_array.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/delete_array_2d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/delete_array_index.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/delete_array_index_2d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/delete_function.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/delete_struct.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/division_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/division_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/division_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/division_4.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/division_5.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/division_6.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/division_7.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_4.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_5.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/index_access_for_bytes.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/mod.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/mod_even.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/mod_n.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/mod_n_uint16.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/unary_add.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/unary_add_array.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/unary_add_mapping.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/unary_sub.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/unary_sub_array.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/operators/unary_sub_mapping.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/overflow/overflow_mul.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/overflow/overflow_mul_signed.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/overflow/overflow_sum.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/overflow/overflow_sum_signed.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/overflow/safe_add_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/overflow/safe_add_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/overflow/safe_sub_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/overflow/simple_overflow.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/overflow/underflow_sub.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/overflow/underflow_sub_signed.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/simple/smoke_test.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/simple/static_array.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/abi_decode_memory_v2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/abi_decode_memory_v2_value_types.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/abi_decode_simple.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/blockhash.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/difficulty.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/gasleft.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/many.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/msg_data.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/msg_sender_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/msg_sender_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/msg_sender_fail_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/msg_sig.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/this.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/special/this_state.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/cast_address_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/cast_different_size_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/cast_larger_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/cast_larger_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/cast_larger_2_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/cast_larger_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/cast_smaller_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/cast_smaller_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/cast_smaller_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/enum_from_uint.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/enum_to_uint_max_value.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/function_type_to_function_type_external.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/function_type_to_function_type_internal.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_function_call.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_modifier.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_return.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_return_multi.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/address_balance.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/address_call.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/address_delegatecall.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/address_staticcall.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/address_transfer.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/address_transfer_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/address_transfer_insufficient.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_4.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_5.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_branch_1d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_branch_2d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_branch_3d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_branches_1d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_branches_2d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_branches_3d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_dynamic_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_dynamic_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_dynamic_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_dynamic_2_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_dynamic_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_dynamic_3_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_dynamic_parameter_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_dynamic_parameter_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_literal_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_mapping_aliasing_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_mapping_aliasing_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_static_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_static_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_static_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_static_2_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_static_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_static_3_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_static_aliasing_memory_5.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_static_aliasing_storage_5.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_static_mapping_aliasing_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_static_mapping_aliasing_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/array_struct_array_branches_2d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/bool_int_mixed_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/bool_int_mixed_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/bool_int_mixed_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/bool_simple_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/bool_simple_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/bool_simple_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/bool_simple_4.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/bool_simple_5.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/bool_simple_6.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/bytes_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/bytes_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/bytes_2_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/contract.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/contract_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/contract_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/contract_address_conversion.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/contract_address_conversion_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/data_location_in_function_type.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/enum_explicit_values.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/enum_explicit_values_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/enum_in_library.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/enum_in_library_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/enum_in_struct.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/enum_storage_eq.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/enum_transitivity.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/fixed_bytes_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/function_type_array_as_reference_type.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/function_type_arrays.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/function_type_as_argument.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/function_type_call.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/function_type_external_address.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/function_type_members.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/function_type_nested.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/function_type_nested_return.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_2d_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_2d_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_3d_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_3d_1_fail.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_4.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_5.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_aliasing_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_aliasing_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_and_array_of_functions.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_as_local_var_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_as_parameter_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_equal_keys_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_equal_keys_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/mapping_unsupported_key_type_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/no_effect_statements.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/rational_large_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/storage_value_vars_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/storage_value_vars_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/storage_value_vars_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/storage_value_vars_4.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/string_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/string_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/string_literal_assignment_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/string_literal_assignment_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/string_literal_assignment_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/string_literal_assignment_4.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/string_literal_assignment_5.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/string_literal_comparison_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/string_literal_comparison_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/struct_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/struct_array_branches_1d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/struct_array_branches_2d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/struct_array_branches_3d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_assignment.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_assignment_array.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_assignment_array_empty.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_assignment_compound.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_assignment_empty.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_assignment_multiple_calls.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_declarations.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_declarations_empty.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_declarations_function.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_declarations_function_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_declarations_function_empty.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_function.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_function_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_function_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/tuple_return_branch.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/type_expression_array_2d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/type_expression_array_3d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/type_expression_tuple_array_2d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/types/type_expression_tuple_array_3d.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/verification_target/constant_condition_1.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/verification_target/constant_condition_2.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/verification_target/constant_condition_3.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/verification_target/simple_assert.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/verification_target/simple_assert_with_require.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTests/verification_target/simple_assert_with_require_message.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTestsJSON/multi.json delete mode 100644 compiler/test/libsolidity/smtCheckerTestsJSON/multi.sol delete mode 100644 compiler/test/libsolidity/smtCheckerTestsJSON/simple.json delete mode 100644 compiler/test/libsolidity/smtCheckerTestsJSON/simple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/abstract/abstract_contract_because_of_interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/abstract/abstract_contract_instantiation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/abstract/abstract_only.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/abstract/abstract_without_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/abstract/contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/abstract/interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/abstract/library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/abstract/unimplemented_functions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/abstract/unimplemented_functions_inherited.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/array_pop.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/array_pop_arg.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/bytes_pop.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/calldata.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/calldata_assign.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/calldata_dynamic.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/calldata_multi.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/calldata_multi_dynamic.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/calldata_multi_dynamic_V1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/calldata_resize.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/contract_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/dynamic_memory_array_pop.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/invalid/contract_index_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/invalid/library_index_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/array_length_cannot_be_constant_function_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/bytes32_too_large.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/bytes32_too_large_multidim.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/can_be_constant_in_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/can_be_constant_in_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/can_be_recursive_constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/cannot_be_assigned.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/cannot_be_assigned_mapping.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/cannot_be_assigned_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/cannot_be_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/cannot_be_function_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/complex_cyclic_constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/const_cannot_be_fractional.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/constant_var.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/cyclic_constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/fixed_size_multidim_zero_length.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/fixed_size_zero_length.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/inline_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/invalid_expression_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/invalid_expression_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/invalid_expression_3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/invalid_expression_4.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/invalid_expression_5.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/non_integer_constant_var.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/not_convertible_to_integer.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/not_too_large.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/parameter_too_large.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/parameter_too_large_multidim.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/parameter_too_large_multidim_ABIv2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/parentheses.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/pure_functions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/too_large.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/tuples.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/length/uint_too_large_multidim.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/new_no_parentheses.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/no_array_pop.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/pop/calldata_pop.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/pop/memory_pop.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/push/calldata_push.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/push/memory_push.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/bytes_calldata.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/bytes_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/bytes_storage.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/calldata_dynamic.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/calldata_dynamic_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/calldata_dynamic_convert_to_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/calldata_dynamic_encode.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/calldata_dynamic_forward.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/calldata_static.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/memory_dynamic.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/memory_static.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/slice_literal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/slice_memory_bytes.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/slice_memory_string.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/slice_string.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/storage_dynamic.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/slice/storage_static.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/static_storage_array_pop.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/string_pop.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/array/uninitialized_storage_var.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/bound/bound_all.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/bound/bound_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/bound/bound_no_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/bytecode_too_large.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constants/abi_encoding_constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constants/addmod_mulmod_rational.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constants/addmod_zero.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constants/assign_constant_function_value.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constants/cyclic_dependency_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constants/cyclic_dependency_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constants/cyclic_dependency_3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constants/cyclic_dependency_4.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constants/division_by_zero.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constants/mod_div_rational.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constants/mod_zero.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constants/mulmod_zero.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constants/pure_non_rational.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/abstract_creation_forward_reference.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/constructible_internal_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/constructor_no_visibility.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/constructor_old.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/constructor_state_mutability.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/constructor_visibility.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/constructor_without_implementation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/external_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/function_named_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/inconstructible_internal_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/inconstructible_internal_constructor_inverted.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/interface_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/library_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/not_a_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/overriding_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/returns_in_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor/two_constructors.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/constructor_this.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/mappingReturn/named_err.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/mappingReturn/named_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/mappingReturn/unnamed_err.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/mappingReturn/unnamed_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/assembly_err.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/default_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/dowhile_err.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/dowhile_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/for_err.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/for_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/if_err.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/if_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/modifier_err.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/modifier_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/revert_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/short_circuit_err.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/short_circuit_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/smoke.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/ternary_err.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/ternary_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/try_err.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/try_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/tuple_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/unimplemented_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/unimplemented_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/while_err.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/storageReturn/while_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/always_revert.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/assembly.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/functionType.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/modifier_order_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/modifier_order_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/modifier_post_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/modifier_pre_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/smoke.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/unreachable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/unreachableCode/comment_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/unreachableCode/constant_condition.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/unreachableCode/do_while_continue.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/unreachableCode/double_return.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/unreachableCode/double_revert.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/unreachableCode/for_break.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/unreachableCode/if_both_return.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/unreachableCode/revert.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/unreachableCode/revert_empty.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/unreachableCode/while_break.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/controlFlow/unreachableCode/while_continue.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/allowed_conversion_to_bytes_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/allowed_conversion_to_string.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/conversion_to_bytes.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/explicit_conversion_address_to_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/explicit_conversion_from_storage_array_ref.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/explicit_conversion_sender_to_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/explicit_conversion_this_to_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/function_type_nonpayable_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/function_type_nonpayable_pure.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/function_type_nonpayable_view.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/function_type_payable_nonpayable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/function_type_payable_pure.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/function_type_payable_view.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/function_type_pure_nonpayable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/function_type_pure_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/function_type_pure_view.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/function_type_same.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/function_type_view_nonpayable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/function_type_view_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/function_type_view_pure.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/implicit_conversion_from_storage_array_ref.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/not_allowed_conversion_from_super.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/not_allowed_conversion_to_int_array_pointer1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/conversion/not_allowed_conversion_to_int_array_pointer2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/externalFunction/external_function_return_parameters_no_data_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_calldata.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_storage.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/function_argument_location_specifier_test_non_reference_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/function_parameters_with_data_location_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/function_return_parameters_with_data_location_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/function_type_array_as_reference_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_calldata.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_storage.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/internalFunction/internal_function_parameters_no_data_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/internalFunction/internal_function_return_parameters_no_data_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/libraries/library_external_function_params_no_data_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/libraries/library_external_function_return_no_data_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_with_data_location_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/libraries/library_internal_function_no_data_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/libraries/library_private_function_no_data_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/libraries/library_public_function_no_data_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_calldata.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_storage.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_calldata.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_storage.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/memory_storage_data_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_parameters_no_data_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_return_parameters_no_data_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_calldata.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_storage.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_parameters_no_data_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_return_parameters_no_data_location.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/variable_declaration_location_specifier_test_non_reference_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/dataLocations/variable_declaration_location_specifier_test_reference_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/denominations/combining_hex_and_denomination.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/denominations/denominations.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/denominations/deprecated_year.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/denominations/fixed_point_division.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/deprecated_functions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/double_stateVariable_declaration.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/double_variable_declaration.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/emit/emit_empty.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/emit/emit_non_event.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/empty_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/enums/global_enum.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/enums/global_enum_contract_name_clash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/enums/global_enum_name_clash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/enums/global_enum_shadowing.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/events/event_array_indexed_v2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/events/event_array_v2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/events/event_nested_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/events/event_nested_array_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/events/event_nested_array_in_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/events/event_nested_array_indexed_v2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/events/event_nested_array_v2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/events/event_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/events/event_struct_indexed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/events/event_struct_indexed_v2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/events/event_struct_v2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/default_visibility.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/fallback_as_function_name.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/old_syntax.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/payable_fallback_with_inherited_receive.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/payable_fallback_without_receive_empty.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/payable_fallback_without_receive_nonempty.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/payable_fallback_without_receive_nonempty_by_inheritance.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/payable_fallback_without_receive_only_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/pure_modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/return_value_number.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/return_value_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/return_value_unsupported.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/fallback/view_modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/arbitrary_parameters_but_restricted_first_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/call_options_overload.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/calloptions_duplicated.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/calloptions_on_delegatecall.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/calloptions_on_internal_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/calloptions_repeated.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/invalid_expressions_with_calloptions1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/invalid_expressions_with_calloptions2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/invalid_expressions_with_calloptions3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/lowlevel_call_options.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/named_arguments_for_functions_that_take_arbitrary_parameters.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/named_arguments_overload.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/named_arguments_overload_failing1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/named_arguments_overload_failing2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/named_arguments_overload_failing3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/new_with_calloptions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/new_with_calloptions_unsupported.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionCalls/new_with_invalid_calloptions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/call_value_on_non_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/call_value_on_non_payable_function_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/call_value_on_payable_function_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/conversion_to_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/delete_external_function_type_invalid.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/delete_function_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/delete_function_type_invalid.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/external_function_to_function_type_calldata_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/external_function_type_public_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/external_function_type_returning_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/external_function_type_taking_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/external_function_type_to_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/external_function_type_to_address_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/external_function_type_to_uint.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/function_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/function_type_arrays.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/function_type_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/function_type_constructor_local.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/function_type_internal_public_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/function_type_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/function_type_return_parameters_with_names.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/function_type_returned.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/function_type_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/function_type_struct_undefined_member.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/function_type_variable_external_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/function_types_internal_visibility_error.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/function_types_variable_visibility.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/internal_function_array_memory_as_external_parameter_in_library_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/internal_function_array_storage_as_external_parameter_in_library_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/internal_function_as_external_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/internal_function_as_external_parameter_in_library_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/internal_function_as_external_parameter_in_library_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/internal_function_returned_from_public_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/internal_function_struct_as_external_parameter_in_library_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/internal_function_type_to_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/payable_internal_function_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/payable_internal_function_type_is_not_fatal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/private_function_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/public_function_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/valid_function_type_variables.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/functionTypes/warn_function_type_parameters_with_names.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/getter/complex_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/getter/nested_structs.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/getter/recursive_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/getter/simple_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/globalFunctions/call_with_wrong_arg_count.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/globalFunctions/callcode_with_wrong_arg_count.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/globalFunctions/delegatecall_with_wrong_arg_count.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/globalFunctions/keccak256_with_wrong_arg_count.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/globalFunctions/ripemd160_with_wrong_arg_count.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/globalFunctions/sha256_with_wrong_arg_count.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/globalFunctions/sha3_no_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/globalFunctions/sha3_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/globalFunctions/sha3_var.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/globalFunctions/suicide_no_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/globalFunctions/suicide_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/globalFunctions/suicide_var.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/circular_import.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/complex_import.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/filename_with_period.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/import_does_not_clutter_importee.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/import_is_transitive.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_match.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/library_name_clash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/library_name_clash_with_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_4.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_5.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_contract_struct_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_contract_struct_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_contract_struct_3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_contract_struct_4.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_contract_struct_5.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_enum.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_enum_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_enum_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_struct_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_struct_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_struct_3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_struct_4.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_struct_5.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_struct_contract_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_struct_contract_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_struct_contract_3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_struct_contract_4.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/name_clash_in_import_struct_contract_5.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/regular_import.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/relative_import.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/relative_import_multiplex.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/shadowing_builtins_with_alias.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/shadowing_builtins_with_imports.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/shadowing_builtins_with_multiple_imports.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/shadowing_via_import.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/simple_alias.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/imports/smoke_test.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/indexing/array_multidim_rational.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/indexing/array_multim_overflow_index.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/indexing/array_negative_index.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/indexing/array_noninteger_index.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/indexing/array_out_of_bounds_index.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/indexing/array_without_index.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/indexing/fixedbytes_negative_index.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/indexing/fixedbytes_noninteger_index.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/indexing/fixedbytes_out_of_bounds_index.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/indexing/fixedbytes_without_index.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/indexing/function_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/indexing/function_type_without_index.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/indexing/struct_array_noninteger_index.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/allow_empty_duplicated_super_constructor_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/base_arguments_multiple_inheritance.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/base_arguments_no_parentheses.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/disallow_modifier_style_without_parentheses.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/duplicated_constructor_call/ancestor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/duplicated_constructor_call/base.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/duplicated_constructor_call/base_multi.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/duplicated_constructor_call/base_multi_no_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/duplicated_constructor_call/base_multi_no_constructor_modifier_style.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/fallback_receive/fallback_overrides_receive.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/fallback_receive/fallback_with_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/fallback_receive/fallback_with_override_intermediate.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/fallback_receive/fallback_without_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/fallback_receive/fallback_without_override_intermediate.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/fallback_receive/receive_overrides_fallback.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/fallback_receive/receive_with_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/fallback_receive/receive_with_override_intermediate.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/fallback_receive/receive_without_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/fallback_receive/receive_without_override_intermediate.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface/contract_base.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface/diamond/diamond_no_relist.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface/diamond/diamond_with_relist.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface/implementation/complete.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface/implementation/partial.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface/linearization/invalid/lists_a.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface/linearization/invalid/lists_b.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface/linearization/invalid/lists_both.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface/linearization/valid.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface/multiple_parents.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface/overrides_multiple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface/overrides_single.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface/single_parent.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/interface_virtual_warning.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/modifiers_in_constructor_context.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/add_view.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/ambiguous_base_and_unique_implementation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/ambiguous_base_and_unique_mention.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/ambiguous_base_functions_overridden_in_intermediate_base.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/ambiguous_base_functions_overridden_in_intermediate_base_unimplemented.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/calldata_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/calldata_memory_conflict.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/calldata_memory_interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/calldata_memory_interface_instantiate.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/calldata_memory_interface_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/calldata_memory_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/change_return_types_in_interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/common_base_and_unique_implementation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/common_base_and_unique_mention.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/detect_double_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/diamond_interface_empty_intermediate_public_state_variable_and_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/diamond_interface_intermediate_public_state_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/diamond_interface_intermediate_public_state_variable_and_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/diamond_interface_intermediate_public_state_variable_and_function_implemented.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/diamond_top_implemented_intermediate_empty_bottom_public_state_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/diamond_top_implemented_intermediate_implemented_public_state_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/diamond_top_implemented_intermediate_public_state_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/external_turns_public_no_params.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/function_pointer.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/function_state_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/implement_interface_by_public_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/implement_internal_function_by_public_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/implement_private_function_by_public_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/implement_public_function_by_public_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/internal_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/internal_external_inheritance.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/modifier_ambiguous.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/modifier_ambiguous_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/modifier_inherited_different_signature.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/modifier_inherited_different_signature_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/no_common_base_and_unique_implementation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/nonintermediate_common_base_and_unique_implementation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/nonintermediate_common_base_and_unique_implementation_modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/nonintermediate_common_base_and_unique_implementation_unimplemented.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_ambiguous.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_base_base.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_empty_list.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_interface_multiple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_missing_virtual.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_modifier_no_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_multiple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_multiple2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_multiple_duplicated.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_multiple_fail1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_multiple_fail2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_multiple_fail3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_multiple_fail4.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_multiple_missing.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_multiple_no_virtual.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_multiple_no_virtual2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_multiple_unresolved.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_public_vars.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_return_mismatch.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_shared_base.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_shared_base_partial.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_shared_base_simple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_type_mismatch.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_unimplemented_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/override_unimplemented_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_var_implements_parallel_interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_var_missing_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_var_no_override_but_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_var_overrides_public_var.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_var_overriding_multiple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_var_overriding_multiple_derived.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_var_parallel_funciton.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_var_same_name_but_different_args.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_var_surplus_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_vars_multiple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_vars_multiple1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_vars_multiple2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_vars_multiple3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_vars_multiple4.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_vars_multiple5.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_vars_multiple_diamond.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_vars_multiple_diamond1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_vars_multiple_diamond2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_vars_multiple_explicit_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/public_vars_wrong_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/remove_view.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/state_variable_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/triangle_impl.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/triangle_no_impl.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/override/virtual_private.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/reference_non_base_ctor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/shadowing_base_state_vars.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/shadowing_private_base_state_vars.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/super_on_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/unimplemented_without_virtual.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/virtual/duplicate.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/virtual/simple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inheritance/wrong_type_base_arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/assignment_from_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/assignment_from_functiontype.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/assignment_from_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/assignment_from_super.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/assignment_to_special.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/constant_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/constant_access_non_initialized.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/constant_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/constant_bytes_ref.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/constant_computation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/constant_ref.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/function_call_invalid_argument_count.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/function_call_not_found.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/function_call_to_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/function_without_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/in_modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/assign_to_instruction.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/bare_instructions_disallowed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/calldata_variables.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/constant_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/constant_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/constant_variable_via_offset.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/empty_fun_arg_beginning.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/empty_fun_arg_end.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/empty_fun_arg_middle.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/empty_function_name.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/invalid_number.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/jump_disallowed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/label_disallowed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/leave_items_on_tack.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/literals_on_stack_disallowed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/local_variable_access_out_of_functions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/local_variable_access_out_of_functions_storage_ptr.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/missing_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/missing_variable_in_assign.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/multiple_assign_to_instruction.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/nested_function_local_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/storage_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/storage_assignment_in_modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/storage_variable_access_out_of_functions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/unbalanced_negative_stack.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/unbalanced_positive_stack.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/unbalanced_two_stack_load.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/variable_declaration_suffix_offset.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/whitespace_in_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/invalid/whitespace_in_multiple_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/istanbul.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/istanbul_on_petersburg.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/leave.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/leave_invalid.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/no_unused_variable_warning.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/overloaded_reference.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/period_in_identifer.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/shadowing/argument.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/shadowing/constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/shadowing/contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/shadowing/function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/shadowing/local_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/shadowing/name_clash_in_import.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/shadowing/no_name_clash_in_import.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/shadowing/qualified_names.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_empty_offset.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_empty_slot.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_on_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_on_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/two_stack_slots.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/use_msize_with_optimizer.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inlineAssembly/use_msize_without_optimizer.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inline_arrays/dynamic_inline_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inline_arrays/inline_array_declaration_and_passing_implicit_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inline_arrays/inline_array_declaration_and_passing_implicit_conversion_strings.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inline_arrays/inline_array_declaration_const_int_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inline_arrays/inline_array_declaration_const_string_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inline_arrays/inline_array_declaration_no_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inline_arrays/inline_array_declaration_no_type_strings.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inline_arrays/inline_array_fixed_types.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inline_arrays/inline_array_of_mapping_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inline_arrays/inline_array_rationals.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inline_arrays/invalid_types_in_inline_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/inline_arrays/lvalues_as_inline_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/literalOperations/division_by_zero.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/literalOperations/division_by_zero_complex.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/literalOperations/mod_zero.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/literalOperations/mod_zero_complex.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/literal_comparisons.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/literals/hex_string_duplicate_underscore.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/literals/hex_string_leading_underscore.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/literals/hex_string_misaligned_underscore.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/literals/hex_string_trailing_underscore.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/literals/hex_string_underscores_valid.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/lvalues/calldata_index_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/lvalues/calldata_member_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/lvalues/external_reference_argument.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/lvalues/functions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/lvalues/library_mapping.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/lvalues/valid_lvalues.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/memberLookup/contract_not_payable_send.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/memberLookup/contract_not_payable_transfer.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup_in_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/memberLookup/internal_function_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/memberLookup/member_not_unique.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/memberLookup/member_value_not_unique.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/memberLookup/memory_structs_with_mapping_array_struct_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/memberLookup/memory_structs_with_mappings.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/memberLookup/msg_value_modifier_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/memberLookup/msg_value_modifier_pure.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/memberLookup/msg_value_modifier_view.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/memberLookup/push_on_memory_types.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/codeAccess.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/codeAccessAbstractCreation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/codeAccessAbstractRuntime.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/codeAccessBase.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/codeAccessCyclic.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/codeAccessIsConstant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/codeAccessLibrary.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/codeIsNoLValue.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/name.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/name_constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/name_other_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/noArgForType.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/runtimeCodeWarningAssembly.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/tooManyArgsForType.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/typeNotRegularIdentifierContractName.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/typeNotRegularIdentifierFunction.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/typeNotRegularIdentifierParameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/typeNotRegularIdentifierStateVariable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/typeNotRegularIdentifierVariable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/typeOfContract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/typeRecursive.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/metaTypes/unsupportedArgForType.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/missing_state_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/base_constructor_double_invocation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/constructor_as_modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/constructor_call_invalid_arg_count.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/function_modifier_double_invocation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/function_modifier_invocation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/function_modifier_invocation_local_variables.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/function_modifier_invocation_parameters.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/function_overrides_modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/illegal_modifier_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/invalid_function_modifier_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/legal_modifier_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/modifier_overrides_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/modifier_returns_value.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/modifier_without_underscore.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/modifiers_on_abstract_functions_no_parser_error.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/non-virtual_modifier_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/modifiers/use_in_invalid_context.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/more_than_256_declarationerrors.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/more_than_256_syntaxerrors.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiSource/error_in_first.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiSource/import.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiSource/import_not_found.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiSource/no_import.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiSource/one_source.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiSource/warning_in_both.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/differentNumberOfComponents.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/differentNumberOfComponentsFromReturn.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/disallowWildcards.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/disallowWildcardsFromReturn.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/multiSingleVariableDeclaration.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/multiVariableDeclarationComplex.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/multiVariableDeclarationEmpty.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/multiVariableDeclarationInvalidType.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/multiVariableDeclarationScoping.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/multiVariableDeclarationScoping2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/multiVariableDeclarationSimple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/multiVariableDeclarationThatIsExpression.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/oneElementTuple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiVariableDeclaration/sameNumberOfComponents.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/multiline_comments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/001_name_references.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/002_undeclared_name.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/003_undeclared_name_is_not_fatal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/004_reference_to_later_declaration.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/010_type_conversion_for_comparison.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/011_type_conversion_for_comparison_invalid.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/013_large_string_literal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/014_balance.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/015_balance_invalid.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/017_assignment_to_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/018_forward_function_reference.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/019_comparison_bitop_precedence.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/020_comparison_of_function_types_lt_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/021_comparison_of_function_types_lt_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/022_comparison_of_function_types_gt_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/023_comparison_of_function_types_gt_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/024_comparison_of_function_types_eq.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/025_comparison_of_mapping_types.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/029_create_abstract_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/030_redeclare_implemented_abstract_function_as_abstract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/039_functions_with_identical_structs_in_interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/040_functions_with_different_structs_in_interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/041_functions_with_stucts_of_non_external_types_in_interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/042_functions_with_stucts_of_non_external_types_in_interface_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/043_functions_with_stucts_of_non_external_types_in_interface_nested.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/044_returning_multi_dimensional_arrays_new_abi.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/045_returning_multi_dimensional_arrays.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/046_returning_multi_dimensional_static_arrays.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/047_returning_arrays_in_structs_new_abi.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/048_returning_arrays_in_structs_arrays.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/049_function_external_call_allowed_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/050_function_external_call_not_allowed_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/051_function_internal_allowed_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/052_function_internal_not_allowed_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/053_hash_collision_in_interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/054_inheritance_basic.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/055_inheritance_diamond_basic.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/056_cyclic_inheritance.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/057_legal_override_direct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/058_legal_override_indirect.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/059_illegal_override_visibility.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/060_complex_inheritance.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/061_missing_base_constructor_arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/062_base_constructor_arguments_override.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/063_implicit_derived_to_base_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/064_implicit_base_to_derived_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/065_super_excludes_current_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/067_function_clash_with_state_variable_accessor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/069_base_class_state_variable_accessor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/070_struct_accessor_one_array_only.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/071_base_class_state_variable_internal_member.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/072_state_variable_member_of_wrong_class1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/073_state_variable_member_of_wrong_class2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/074_fallback_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/075_fallback_function_with_arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/076_fallback_function_in_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/076_receive_function_in_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/077_fallback_function_with_return_parameters.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/078_fallback_function_twice.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/079_fallback_function_inheritance.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/080_event.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/081_event_too_many_indexed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/082_anonymous_event_four_indexed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/083_anonymous_event_too_many_indexed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/084_events_with_same_name.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/085_events_with_same_name_unnamed_arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/086_events_with_same_name_different_types.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/087_double_event_declaration.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/088_double_event_declaration_ignores_anonymous.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/089_double_event_declaration_ignores_indexed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/090_event_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/091_event_function_inheritance_clash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/092_function_event_inheritance_clash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/093_function_event_in_contract_clash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/094_event_inheritance.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/095_multiple_events_argument_clash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/096_access_to_default_function_visibility.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/097_access_to_internal_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/098_access_to_default_state_variable_visibility.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/099_access_to_internal_state_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/100_error_count_in_named_args.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/101_empty_in_named_args.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/102_duplicate_parameter_names_in_named_args.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/103_invalid_parameter_names_in_named_args.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/104_empty_name_input_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/105_constant_input_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/106_empty_name_return_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/107_empty_name_input_parameter_with_named_one.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/108_empty_name_return_parameter_with_named_one.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/110_no_overflow_with_large_literal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/111_overflow_caused_by_ether_units.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/112_exp_operator_exponent_too_big.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/113_exp_warn_literal_base_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/114_exp_warn_literal_base_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/115_exp_warn_literal_base_3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/116_shift_warn_literal_base_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/117_shift_warn_literal_base_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/118_shift_warn_literal_base_3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/119_shift_warn_literal_base_4.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/124_enum_member_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/125_enum_member_access_accross_contracts.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/126_enum_invalid_member_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/127_enum_invalid_direct_member_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/128_enum_explicit_conversion_is_okay.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/129_int_to_enum_explicit_conversion_is_okay.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/130_enum_implicit_conversion_is_not_okay_256.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/131_enum_implicit_conversion_is_not_okay_64.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/132_enum_to_enum_conversion_is_not_okay.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/133_enum_duplicate_values.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/134_enum_name_resolution_under_current_contract_name.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/135_private_visibility.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/136_private_visibility_via_explicit_base_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/137_external_visibility.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/138_similar_name_suggestions_expected.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/139_no_name_suggestion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/140_multiple_similar_suggestions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/141_multiple_scopes_suggestions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/142_inheritence_suggestions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/143_no_spurious_identifier_suggestions_with_submatch.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/144_no_spurious_identifier_suggestions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/145_external_base_visibility.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/146_external_argument_assign.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/147_external_argument_increment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/148_external_argument_delete.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/149_test_for_bug_override_function_with_bytearray_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/150_array_with_nonconstant_length.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/151_array_with_negative_length.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/152_array_copy_with_different_types1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/153_array_copy_with_different_types2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/154_array_copy_with_different_types_conversion_possible.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/155_array_copy_with_different_types_static_dynamic.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/156_array_copy_with_different_types_dynamic_static.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/157_array_of_undeclared_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/158_storage_variable_initialization_with_incorrect_type_int.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/159_storage_variable_initialization_with_incorrect_type_string.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/160_test_byte_is_alias_of_byte1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/164_assigning_value_to_const_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/165_assigning_state_to_const_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/167_constant_string_literal_disallows_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/168_assignment_to_const_var_involving_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/169_assignment_to_const_var_involving_expression.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/170_assignment_to_const_var_involving_keccak.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/171_assignment_to_const_array_vars.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/172_assignment_to_const_string_bytes.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/173_constant_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/174_address_is_constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/175_uninitialized_const_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/176_overloaded_function_cannot_resolve.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/177_ambiguous_overloaded_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/178_assignment_of_nonoverloaded_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/179_assignment_of_overloaded_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/180_external_types_clash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/181_override_changes_return_types.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/182_equal_overload.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/185_invalid_utf8_implicit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/186_invalid_utf8_explicit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/187_large_utf8_codepoint.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/188_string_index.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/189_string_length.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/190_negative_integers_to_signed_out_of_bound.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/191_negative_integers_to_signed_min.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/192_positive_integers_to_signed_out_of_bound.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/193_positive_integers_to_signed_out_of_bound_max.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/194_negative_integers_to_unsigned.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/195_positive_integers_to_unsigned_out_of_bound.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/196_integer_boolean_or.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/197_integer_boolean_and.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/198_integer_boolean_not.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/199_integer_unsigned_exp_signed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/200_integer_signed_exp_unsigned.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/201_integer_signed_exp_signed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/202_bytes_reference_compare_operators.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/204_overwrite_memory_location_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/205_overwrite_storage_location_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/206_storage_location_local_variables.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/207_no_mappings_in_memory_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/208_assignment_mem_to_local_storage_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/209_storage_assign_to_different_local_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/210_uninitialized_mapping_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/211_uninitialized_mapping_array_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/213_no_delete_on_storage_pointers.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/214_assignment_mem_storage_variable_directly.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/215_function_argument_mem_to_storage.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/216_function_argument_storage_to_mem.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/217_mem_array_assignment_changes_base_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/219_memory_arrays_not_resizeable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/220_struct_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/221_struct_constructor_nested.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/222_struct_named_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/223_literal_strings.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/224_string_bytes_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/225_inheriting_from_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/226_inheriting_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/227_library_having_variables.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/228_valid_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/229_call_to_library_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/230_creating_contract_within_the_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/231_array_out_of_bound_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/232_literal_string_to_storage_pointer.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/233_non_initialized_references.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/235_abi_encode_with_large_integer_constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/236_cyclic_binary_dependency.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/237_cyclic_binary_dependency_via_inheritance.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/244_tuples.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/245_tuples_empty_components.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/250_member_access_parser_ambiguity.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/251_using_for_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/252_using_for_not_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/253_using_for_function_exists.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/254_using_for_function_on_int.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/255_using_for_function_on_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/256_using_for_overload.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/257_using_for_by_name.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/258_using_for_mismatch.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/259_using_for_not_used.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/260_library_memory_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/261_using_for_arbitrary_mismatch.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/262_bound_function_in_var.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/263_create_memory_arrays.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/264_mapping_in_memory_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/265_new_for_non_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/268_function_overload_array_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/275_inline_struct_declaration_arrays.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/279_break_not_in_loop.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/280_continue_not_in_loop.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/281_continue_not_in_loop_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/282_invalid_different_types_for_conditional_expression.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/283_left_value_in_conditional_expression_not_supported_yet.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/284_conditional_expression_with_different_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/285_conditional_expression_with_different_function_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/286_conditional_expression_with_different_enum.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/287_conditional_expression_with_different_mapping.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/288_conditional_with_all_types.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/289_uint7_and_uintM_as_identifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/291_modifier_is_not_a_valid_typename.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/292_modifier_is_not_a_valid_typename_is_not_fatal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/293_function_is_not_a_valid_typename.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/294_long_uint_variable_fails.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/295_bytes10abc_is_identifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/296_int10abc_is_identifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/297_library_functions_do_not_have_value.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/298_invalid_fixed_types_0x7_mxn.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/299_invalid_fixed_types_long_invalid_identifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/300_invalid_fixed_types_7x8_mxn.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/301_library_instances_cannot_be_used.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/302_invalid_fixed_type_long.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/303_fixed_type_int_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/304_fixed_type_rational_int_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/305_fixed_type_rational_fraction_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/306_invalid_int_implicit_conversion_from_fixed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/307_rational_unary_minus_operation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/308_rational_unary_plus_operation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/312_leading_zero_rationals_convert.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/313_fixed_type_size_capabilities.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/314_fixed_type_zero_handling.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/315_fixed_type_invalid_implicit_conversion_size.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/316_fixed_type_invalid_implicit_conversion_lost_data.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/317_fixed_type_valid_explicit_conversions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/318_invalid_array_declaration_with_rational.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/319_invalid_array_declaration_with_signed_fixed_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/320_invalid_array_declaration_with_unsigned_fixed_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/321_rational_to_bytes_implicit_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/322_fixed_to_bytes_implicit_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/323_mapping_with_fixed_literal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/324_fixed_points_inside_structs.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/327_rational_index_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/328_rational_to_fixed_literal_expression.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/329_rational_as_exponent_value_signed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/330_rational_as_exponent_value_unsigned.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/331_rational_as_exponent_half.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/332_rational_as_exponent_value_neg_quarter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/333_fixed_point_casting_exponents_15.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/334_fixed_point_casting_exponents_neg.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/338_rational_bitnot_unary_operation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/339_rational_bitor_binary_operation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/340_rational_bitxor_binary_operation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/341_rational_bitand_binary_operation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/342_missing_bool_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/343_integer_and_fixed_interaction.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/344_one_divided_by_three_integer_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/345_unused_return_value.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/346_unused_return_value_send.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/347_unused_return_value_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/348_unused_return_value_call_value.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/350_unused_return_value_delegatecall.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/351_callcode_deprecated.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/353_callcode_not_deprecated_as_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/354_payable_in_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/355_payable_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/356_payable_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/357_payable_private.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/358_illegal_override_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/359_illegal_override_payable_nonpayable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/360_function_variable_mixin.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/361_calling_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/362_calling_nonpayable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/363_non_payable_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/366_invalid_array_as_statement.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/367_using_directive_for_missing_selftype.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/368_shift_constant_left_negative_rvalue.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/369_shift_constant_right_negative_rvalue.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/370_shift_constant_left_excessive_rvalue.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/371_shift_constant_right_excessive_rvalue.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/372_shift_constant_right_fractional.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/396_invalid_mobile_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/397_warns_msg_value_in_non_payable_public_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/398_does_not_warn_msg_value_in_payable_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/399_does_not_warn_msg_value_in_internal_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/400_does_not_warn_msg_value_in_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/401_does_not_warn_msg_value_in_modifier_following_non_payable_public_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/402_assignment_to_constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/403_return_structs.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/404_read_returned_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/405_address_checksum_type_deduction.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/406_invalid_address_checksum.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/407_invalid_address_no_checksum.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/408_invalid_address_length_short.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/409_invalid_address_length_long.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/410_string_literal_not_convertible_to_address_as_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/411_string_literal_not_convertible_to_address_as_return_value.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/412_early_exit_on_fatal_errors.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/413_address_methods.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/414_interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/415_interface_functions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/416_interface_function_bodies.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/417_interface_events.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/418_interface_inheritance.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/419_interface_structs.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/420_interface_variables.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/421_interface_function_parameters.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/422_interface_enums.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/423_using_interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/424_using_interface_complex.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/425_interface_implement_public_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/426_throw_is_deprecated.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/428_bare_revert.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/429_revert_with_reason.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/430_bare_selfdestruct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/431_bare_assert.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/432_bare_require.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/433_pure_statement_in_for_loop.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/434_pure_statement_check_for_regular_for_loop.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/438_unused_unnamed_function_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/441_unused_unnamed_return_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/442_named_return_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/443_named_return_parameter_with_explicit_return.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/444_unnamed_return_parameter_with_explicit_return.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/445_no_unused_warning_interface_arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/446_no_unused_warning_abstract_arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/447_no_unused_warnings.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/459_function_overload_is_not_shadowing.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/460_function_override_is_not_shadowing.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/461_event_parameter_cannot_shadow_state_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/462_callable_crash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/466_does_not_error_transfer_payable_fallback.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/467_does_not_error_transfer_regular_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/470_specified_storage_no_warn.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/471_unspecified_storage_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/473_storage_location_non_array_or_struct_disallowed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/474_storage_location_non_array_or_struct_disallowed_is_not_fatal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/475_implicit_conversion_disallowed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/476_too_large_arrays_for_calldata_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/477_too_large_arrays_for_calldata_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/478_too_large_arrays_for_calldata_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/479_explicit_literal_to_memory_string_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/480_explicit_literal_to_storage_string_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/481_explicit_literal_to_unspecified_string_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/482_explicit_literal_to_unspecified_string.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/483_modifiers_access_storage_pointer.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/484_function_types_selector_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/485_function_types_selector_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/486_function_types_selector_3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/487_function_types_selector_4.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/488_function_types_selector_5.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/489_function_types_selector_6.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/490_function_types_selector_7.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/491_using_this_in_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/492_do_not_crash_on_not_lvalue.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/493_builtin_keccak256_reject_gas.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/494_builtin_sha256_reject_gas.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/495_builtin_ripemd160_reject_gas.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/496_builtin_ecrecover_reject_gas.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/497_gasleft.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/498_msg_gas_deprecated.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/500_gasleft_shadowing_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/501_gasleft_shadowing_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/502_builtin_keccak256_reject_value.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/503_builtin_sha256_reject_value.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/504_builtin_ripemd160_reject_value.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/505_builtin_ecrecover_reject_value.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/506_large_storage_array_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/507_large_storage_array_simple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/508_large_storage_arrays_combined.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/509_large_storage_arrays_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/510_large_storage_array_mapping.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/511_library_function_without_implementation_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/512_library_function_without_implementation_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/513_library_function_without_implementation_private.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/514_using_for_with_non_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/515_experimental_pragma_empty.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/516_experimental_pragma_unknown_number_literal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/517_experimental_pragma_unknown_string_literal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/518_experimental_pragma_unknown_quoted_string_literal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/519_experimental_pragma_empy_string_literal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/520_experimental_pragma_multiple_same_line.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/521_experimental_pragma_test_warning.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/522_experimental_pragma_duplicate.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/523_reject_interface_creation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/524_accept_library_creation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/526_fallback_marked_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/527_fallback_marked_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/530_tuple_invalid_literal_too_large_for_uint.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/531_tuple_invalid_literal_too_large_unassigned.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/532_tuple_invalid_literal_too_large_for_uint_multi.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/533_tuple_invalid_literal_too_large_exp.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/534_tuple_invalid_literal_too_large_expression.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/535_address_overload_resolution.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/536_array_length_invalid_expression_negative_bool.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/537_array_length_invalid_expression_int_divides_bool.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/538_array_length_invalid_expression_bool_divides_int.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/539_array_length_invalid_expression_scientific_literal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/540_array_length_invalid_expression_division_by_zero.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/541_warn_about_address_members_on_contract_balance.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/542_warn_about_address_members_on_contract_transfer.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/543_warn_about_address_members_on_contract_send.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/544_warn_about_address_members_on_contract_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/545_warn_about_address_members_on_contract_callcode.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/546_warn_about_address_members_on_contract_delegatecall.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/547_warn_about_address_members_on_non_this_contract_balance.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/548_warn_about_address_members_on_non_this_contract_transfer.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/549_warn_about_address_members_on_non_this_contract_send.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/550_warn_about_address_members_on_non_this_contract_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/551_warn_about_address_members_on_non_this_contract_callcode.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/552_warn_about_address_members_on_non_this_contract_delegatecall.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/559_no_warning_for_using_members_that_look_like_address_members.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/560_event_emit_simple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/561_event_emit_complex.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/562_event_emit_foreign_class.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/563_event_without_emit_deprecated.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/568_blockhash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/569_block_blockhash_deprecated.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/570_function_type_undeclared_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/571_function_type_undeclared_type_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/572_function_type_undeclared_type_multi_nested.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/573_similar_name_longer_than_80_not_suggested.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/574_similar_name_shorter_than_80_suggested.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/575_member_member_getter_call_without_parentheses.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/576_member_getter_call_without_parentheses.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/577_member_getter_call_without_parentheses_missing_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/578_private_member_getter_call_without_parentheses.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/579_member_getter_call_without_parentheses_private_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/580_improve_name_suggestion_one_and_two_letters.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/581_improve_name_suggestion_three_letters.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/582_improve_name_suggestion_four_letters.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/583_abi_encode_packed_with_rational_number_constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/584_abi_decode_with_tuple_of_other_than_types.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/585_abi_decode_with_unsupported_types.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/587_event_param_type_outside_storage.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/compoundAssignment/incomp_types.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/compoundAssignment/tuple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/compoundAssignment/tuple_invalid_inline_array_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/constant_mapping.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/creating_memory_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/creating_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/creating_struct_members_skipped.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/explicit_conversions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidTypes/conditional_expression.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidTypes/constructor_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/no_effect_statements.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/events.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/functions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/global_scope.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/ignores_constructor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/ignores_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/parameters.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/return_parameters.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/storage_variables.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/this_super.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/shadowsBuiltin/variables.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/typeChecking/function_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/typeChecking/library_instances.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/typeChecking/return.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/typeChecking/return_tuple_not_convertible.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/typeChecking/return_wrong_number.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/typeChecking/return_wrong_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/warnUnused/function_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/warnUnused/local.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/warnUnused/local_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/nameAndTypeResolution/warnUnused/return_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/natspec/docstring_empty_description.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/natspec/docstring_empty_tag.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/natspec/docstring_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/natspec/dosctring_named_return_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/natspec/invalid/docstring_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/natspec/invalid/dosctring_named_return_param_mismatch.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/natspec/invalid/dosctring_return_size_mismatch.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_constant_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_function_arguments_and_returns.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_in_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_invalid_state_mutability.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_nonpayable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_payable_constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_payable_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_payable_function_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_payable_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_payable_local.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_payable_state_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_payable_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_payable_type_expression.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/address_public_payable_error.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/array_range_and_ternary.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/array_range_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/array_range_nested.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/array_range_no_start.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/array_type_range.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/arrays_in_events.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/arrays_in_expressions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/arrays_in_storage.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/assembly_evmasm_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/assembly_invalid_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/calling_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/comment_end_with_double_star.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/conditional_multiple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/conditional_true_false_literal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/conditional_with_constants.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/conditional_with_variables.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/constant_is_keyword.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/constant_state_modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/constructor_allowed_this.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/constructor_super.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/declaring_fixed_and_ufixed_variables.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/declaring_fixed_literal_variables.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/elemantary_non_address_payable_state_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/elementary_non_address_payable_argument.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/elementary_non_address_payable_local.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/elementary_non_address_payable_return.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/else_if_statement.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/emit_without_event.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/empty_comment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/empty_enum.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/empty_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/enum_from_interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/enum_from_interface_in_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/enum_from_library.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/enum_inheritance_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/enum_inheritance_interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/enum_valid_declaration.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/event.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/event_arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/event_arguments_indexed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/event_with_no_argument_list.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/exp_expression.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/external_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/external_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/fallback_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/fixed_literal_with_double_radix.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/for_loop_simple_initexpr.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/for_loop_simple_noexpr.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/for_loop_single_stmt_body.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/for_loop_vardef_initexpr.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/from_is_not_keyword.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/function_no_body.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/function_normal_comments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/function_type_as_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/function_type_as_storage_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/function_type_as_storage_variable_with_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/function_type_as_storage_variable_with_modifiers.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/function_type_in_expression.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/function_type_in_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/function_type_state_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/if_statement.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/import_complex.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/import_complex_invalid_from.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/import_complex_without_from.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/import_empty.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/import_invalid_token.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/import_simple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/inline_array_declaration.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/inline_array_empty_cells_check_lvalue.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/inline_array_empty_cells_check_without_lvalue.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/interface_basic.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/invalid_fixed_conversion_leading_zeroes_check.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/lexer_numbers_with_underscores_decimal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/lexer_numbers_with_underscores_decimal_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/lexer_numbers_with_underscores_fixed.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/lexer_numbers_with_underscores_fixed_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/lexer_numbers_with_underscores_hex.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/lexer_numbers_with_underscores_hex_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/library_simple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/literal_constants_with_ether_subdenominations.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/literal_constants_with_ether_subdenominations_in_expressions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/local_const_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/location_specifiers_for_locals.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/location_specifiers_for_locals_multi.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/location_specifiers_for_params.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/location_specifiers_for_params_multi.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/location_specifiers_for_state_variables.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/location_specifiers_for_state_variables_multi.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/location_specifiers_with_var.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/malformed_enum_declaration.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/mapping.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/mapping_and_array_of_functions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/mapping_from_address_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/mapping_in_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_4.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/mapping_to_mapping_in_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/missing_argument_in_named_args.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/missing_parameter_name_in_named_args.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/missing_variable_name_in_declaration.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/modifier_arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/modifier_invocation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/modifier_without_semicolon.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/multi_arrays.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/multi_variable_declarations.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/multiple_event_arg_trailing_comma.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/multiple_function_param_trailing_comma.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/multiple_functions_natspec_documentation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/multiple_modifier_arg_trailing_comma.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/multiple_return_param_trailing_comma.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/multiple_statemutability_specifiers.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/new_address_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/new_invalid_type_name.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/no_function_params.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/overloaded_functions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/payable_accessor.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/payable_without_arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/placeholder_in_function_context.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/pragma_illegal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/return_var.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/scientific_notation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/single_event_arg_trailing_comma.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/single_function_param.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/single_function_param_trailing_comma.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/single_modifier_arg_trailing_comma.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/single_return_param_trailing_comma.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/smoke_test.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/struct_definition.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/trailing_comma_in_named_args.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/trailing_dot1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/trailing_dot2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/trailing_dot3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/tuples.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/tuples_decl_without_rhs.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/tuples_without_commas.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/two_exact_functions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/unary_plus_expression.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/var_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/var_in_function_arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/var_storage_var.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/variable_definition_in_mapping.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/visibility_specifiers.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/parsing/while_loop.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/pragma/invalid_pragma.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/pragma/unknown_pragma.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/receiveEther/arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/receiveEther/default_visibility.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/receiveEther/old_syntax.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/receiveEther/pure_modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/receiveEther/receive_as_function_name.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/receiveEther/return_value.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/receiveEther/view_modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/returnExpressions/single_return_mismatching_number.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/returnExpressions/single_return_mismatching_number_named.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/returnExpressions/single_return_mismatching_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/returnExpressions/tuple_return_mismatching_number.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/returnExpressions/tuple_return_mismatching_number_named.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/returnExpressions/valid_returns.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/double_function_declaration.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/double_variable_declaration_disjoint_scope.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/double_variable_declaration_disjoint_scope_activation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/double_variable_declaration_same_and_disjoint_scope.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/double_variable_declaration_same_scope.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/function_state_variable_conflict.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/name_shadowing.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/poly_variable_declaration_same_scope.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/scoping.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/scoping_activation.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/scoping_activation_old.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/scoping_for.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/scoping_for2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/scoping_for3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/scoping_for_decl_in_body.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/scoping_old.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/scoping_self_use.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/state_variable_function_conflict.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/scoping/state_variable_function_conflict_former_crash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/signed_rational_modulus.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/smoke_test.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abi_encodePacked_structs_v2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abi_encode_structs.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abi_encode_structs_abiv2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abi_functions_member_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_calldata.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_empty.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_invalid_arg_count.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_invalid_arg_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_memory_v2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_nontuple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_simple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_single_return.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_singletontuple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_storage.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/encodePacked_array_of_structs.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/encodePacked_dynamic_string_array_v2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/encode_array_of_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/single_non_bytes_arg.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_internal_functions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_types.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/specialFunctions/types_without_encoding_problems.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/string/string_escapes.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/string/string_multipart_hex_valid_parts.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/string/string_multipart_newline_with_hex_prefix.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/string/string_multipart_newline_without_hex_prefix.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/string/string_multipart_only_hex.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/string/string_multipart_only_regular.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/string/string_multipart_single_line.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/string/string_new_line.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/string/string_terminated_by_backslash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/string/string_unterminated.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/string/string_unterminated_no_new_line.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/address_member_access.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/address_member_declaration.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/array_calldata.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/calldata.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/calldata_array_assign.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/calldata_assign.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/calldata_dynamic.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/calldata_struct_function_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/contract_global_struct_name_clash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/global_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/global_struct_contract_name_clash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/global_struct_shadowing.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/global_structs_name_clash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/memory_to_calldata.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/multi_struct_composition.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/parallel_structs.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/recursive_struct_as_contract_function_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/recursive_struct_as_library_function_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/recursive_struct_as_memory_library_function_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/recursive_struct_forward_reference.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/recursive_struct_with_internal_function_as_library_function_parameter.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/static_array_of_recursive_structs.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_directly_recursive.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_directly_recursive_dynamic_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_directly_recursive_fixed_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive_complex.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive_dynamic_array1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive_dynamic_array2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive_dynamic_array3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive_dynamic_multi_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive_fixed_array1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive_fixed_array2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive_fixed_array3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive_fixed_multi_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_not_really_recursive.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_not_really_recursive_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/structs/recursion/struct_definition_recursion_via_mapping.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tight_packing_literals.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tight_packing_literals_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/almost_call_options.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/catch_error.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/catch_error_named.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/catch_low_level.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/empty_catch.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/empty_returns.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/error_with_wrong_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/invalid_error_name.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/invalid_returns.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/library_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/low_level_pre-byzantium.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/low_level_with_wrong_type.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/no_catch.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/no_external_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/no_returns.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/returns.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/returns_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/returns_memory_anonymous.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/simple_catch.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/structured_pre_byzantium.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/two_catch_clauses.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/two_error_catch_clauses.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tryCatch/two_low_level_catch_clauses.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tupleAssignments/double_storage_crash.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tupleAssignments/err_fill_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tupleAssignments/error_fill.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tupleAssignments/large_component_count.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tupleAssignments/nowarn_swap_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tupleAssignments/nowarn_swap_storage_pointers.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/tupleAssignments/warn_multiple_storage_storage_copies.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_abi_decode.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_binary_operators.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_constant_assignment.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_in_struct_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_in_struct_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_members_in_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_nonpayable_selfdestruct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_payable_external_overload.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_payable_internal_overload_nonpayable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_payable_internal_overload_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_payable_memory_array_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_payable_public_overload.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_payable_selfdestruct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_payable_storage_array_conversion.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_payable_storage_array_conversion_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_to_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_to_contract_implicitly.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_to_contract_payable_fallback.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_to_contract_receive.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_to_payable_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_to_payable_address_double.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_tuple_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/address_tuple_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/bytes_long_to_payable_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/bytes_short_to_payable_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/bytes_to_payable_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/contract_no_fallback_to_payable_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/contract_non_payable_fallback_to_payable_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/contract_payable_fallback_to_payable_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/contract_payable_fallback_to_payable_address_implicitly.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/contract_receive_to_payable_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/contract_receive_to_payable_address_implicitly.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/contract_to_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/contract_to_address_implicitly.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/literal_to_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/literal_to_payable_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/nonpayable_address_to_contract_payable_fallback.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/nonpayable_address_to_contract_receive.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/payable_address_to_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/address/uint_to_payable_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/array_index_too_large.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/bool_ops.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/bytes0.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/bytes1_to_uint256.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/bytes256.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/bytes32_to_uint32.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/bytes33.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/bytesXX_index_assign.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/bytes_to_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/bytes_to_uint_same_size.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/bytesm.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/call_unimplemented_internal_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/assign_function_via_base_name_to_var.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/assign_function_via_contract_name_to_var.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/base_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/base_contract_invalid.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/call_function_via_contract_name.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/call_unimplemented_base.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/function_selector_via_contract_name.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/function_selector_via_interface_name.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/function_via_contract_name_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/function_via_contract_name_overloaded.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/function_via_contract_name_private.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/function_via_contract_name_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/modifier_base.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contractTypeType/members/struct_enum.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contract_to_base.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contract_to_base_base.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contract_to_derived.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/contract_to_unrelated_contract.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/cyclic_dependency_check_on_consts_exhausted.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/cyclic_dependency_check_on_consts_good.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/cyclic_dependency_check_on_struct_exhausted.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/cyclic_dependency_check_on_struct_good.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/decimal_literal_to_bytesXX_explicit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/decimal_literal_to_bytesXX_implicit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/empty_tuple_event.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/empty_tuple_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/empty_tuple_lvalue.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/encoding_fractional.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/encoding_fractional_abiencoderv2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/encoding_packed_fractional.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/encoding_packed_fractional_abiencoderv2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/function_call_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/function_call_fail2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/function_types/function_parameter_return_types_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/function_types/function_parameter_return_types_success.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/function_types/function_state_mutability_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/function_types/function_state_mutability_success.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/hex_literal_to_bytesXX_different_size_explicit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/hex_literal_to_bytesXX_different_size_implicit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/hex_literal_to_bytesXX_same_size_explicit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/hex_literal_to_bytesXX_same_size_implicit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/index_access_for_bytes.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/library_function_selector.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/library_function_selector_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/library_function_selector_private_inside.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/library_function_selector_private_outside.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/library_function_selector_view_pure.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/library_internal_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/library_to_address.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/library_to_address_payable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/access_index_omitted.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/argument_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/argument_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/argument_private.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/argument_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/array_argument_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/array_argument_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/array_argument_private.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/array_argument_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/assignment_local.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/assignment_state_variable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/assignment_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/contract_mapping.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/contract_mapping_invalid.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/enum_mapping.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/enum_mapping_invalid.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/function_type_argument_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/function_type_argument_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/function_type_return_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/function_type_return_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/library_argument_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/library_argument_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/library_argument_private.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/library_argument_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/library_array_argument_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/library_array_argument_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/library_array_argument_private.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/library_array_argument_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/library_mapping.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/library_return_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/library_return_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/library_return_private.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/library_return_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_array_data_location_function_param_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_array_return_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_array_return_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_array_return_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_data_location_calldata.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_data_location_default.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_data_location_function_param_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_data_location_function_param_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_data_location_function_param_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_data_location_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_dynamic_key.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_dynamic_key_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_return_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_return_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_return_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/mapping/mapping_return_public_memory.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/no_singleton_tuple.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_negative_numerator_negative_exp.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_array_index_limit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_bitshift_limit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_div_limit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_exp_limit_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_exp_limit_fine.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_huge.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_huge_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_literal_limit_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_literal_limit_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_literal_limit_3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_literal_to_fixed_implicit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_mul_limit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_signed_to_unsigned.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/rational_number_too_large.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/too_small_negative_numbers.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/uint256_to_bytes1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/uint32_to_bytes32.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/unnamed_tuple_decl.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/var_decl_val_mismatch.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/var_empty_decl_0.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/var_empty_decl_1.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/var_empty_decl_2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/var_empty_decl_3.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/var_type_invalid_rational.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/var_type_suggest.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/zero_literal_to_bytesXX_explicit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/types/zero_literal_to_bytesXX_implicit.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/unicode_escape_literals.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/unimplemented_super_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/unimplemented_super_function_derived.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/unterminatedBlocks/one_dot.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/unterminatedBlocks/one_dot_x.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/unterminatedBlocks/zero_dot.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/unterminatedBlocks/zero_dot_x.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/unusedVariables/try_catch.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/upper_case_hex_literals.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/variableDeclaration/do_while.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/variableDeclaration/else.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/variableDeclaration/for.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/variableDeclaration/if.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/variableDeclaration/while.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPure/view_pure_abi_encode.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPure/view_pure_abi_encode_arguments.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/access_to_base_member_constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/access_to_base_member_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/access_to_base_member_struct.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/access_to_base_members.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/array/access_to_array_push.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/array/access_to_array_push_view.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/array/access_to_base_member_array.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/assembly.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_restrict_warning.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_view_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/call_internal_functions_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/call_internal_functions_success.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/callvalue_nonpayable_assembly_fallback.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/callvalue_nonpayable_assembly_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/callvalue_nonpayable_assembly_function_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/callvalue_nonpayable_assembly_function_modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/callvalue_payable_assembly_fallback.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/callvalue_payable_assembly_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/callvalue_payable_assembly_function_modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/constant.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/constant_restrict_warning.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/creation_no_restrict_warning.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/creation_view_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/function_types.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/function_types_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/gas_value_without_call.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/gas_with_call_nonpayable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/interface.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/local_storage_variables.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/local_storage_variables_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/mappings.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/modifiers.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/modifiers_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/msg_value_modifier.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/msg_value_modifier_view.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/overriding_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/overriding_no_restrict_warning.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/read_storage_pure_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/returning_structs_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/returning_structs_no_restrict_warning.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/selector.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/selector_complex.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/selector_complex2.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/smoke_test.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/staticcall_gas_view.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/suggest_pure.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/suggest_view.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/value_with_call_nonpayable.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/viewPureChecker/write_storage_fail.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/virtualLookup/modifiers_in_libraries.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/visibility/external_library_function.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/visibility/function_no_visibility.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/visibility/interface/function_default.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/visibility/interface/function_external.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/visibility/interface/function_internal.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/visibility/interface/function_private.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/visibility/interface/function_public.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/visibility/interface/interface_contract_function_default.sol delete mode 100644 compiler/test/libsolidity/syntaxTests/visibility/library_self_delegatecall.sol delete mode 100644 compiler/test/libsolidity/util/BytesUtils.cpp delete mode 100644 compiler/test/libsolidity/util/BytesUtils.h delete mode 100644 compiler/test/libsolidity/util/ContractABIUtils.cpp delete mode 100644 compiler/test/libsolidity/util/ContractABIUtils.h delete mode 100644 compiler/test/libsolidity/util/SoltestErrors.h delete mode 100644 compiler/test/libsolidity/util/SoltestTypes.h delete mode 100644 compiler/test/libsolidity/util/TestFileParser.cpp delete mode 100644 compiler/test/libsolidity/util/TestFileParser.h delete mode 100644 compiler/test/libsolidity/util/TestFileParserTests.cpp delete mode 100644 compiler/test/libsolidity/util/TestFunctionCall.cpp delete mode 100644 compiler/test/libsolidity/util/TestFunctionCall.h delete mode 100644 compiler/test/libsolidity/util/TestFunctionCallTests.cpp delete mode 100644 compiler/test/libsolutil/Checksum.cpp delete mode 100644 compiler/test/libsolutil/CommonData.cpp delete mode 100644 compiler/test/libsolutil/IndentedWriter.cpp delete mode 100644 compiler/test/libsolutil/IpfsHash.cpp delete mode 100644 compiler/test/libsolutil/IterateReplacing.cpp delete mode 100644 compiler/test/libsolutil/JSON.cpp delete mode 100644 compiler/test/libsolutil/Keccak256.cpp delete mode 100644 compiler/test/libsolutil/StringUtils.cpp delete mode 100644 compiler/test/libsolutil/SwarmHash.cpp delete mode 100644 compiler/test/libsolutil/UTF8.cpp delete mode 100644 compiler/test/libsolutil/Whiskers.cpp delete mode 100644 compiler/test/libyul/Common.cpp delete mode 100644 compiler/test/libyul/Common.h delete mode 100644 compiler/test/libyul/CompilabilityChecker.cpp delete mode 100644 compiler/test/libyul/EwasmTranslationTest.cpp delete mode 100644 compiler/test/libyul/EwasmTranslationTest.h delete mode 100644 compiler/test/libyul/FunctionSideEffects.cpp delete mode 100644 compiler/test/libyul/FunctionSideEffects.h delete mode 100644 compiler/test/libyul/Inliner.cpp delete mode 100644 compiler/test/libyul/Metrics.cpp delete mode 100644 compiler/test/libyul/ObjectCompilerTest.cpp delete mode 100644 compiler/test/libyul/ObjectCompilerTest.h delete mode 100644 compiler/test/libyul/ObjectParser.cpp delete mode 100644 compiler/test/libyul/Parser.cpp delete mode 100644 compiler/test/libyul/StackReuseCodegen.cpp delete mode 100644 compiler/test/libyul/SyntaxTest.cpp delete mode 100644 compiler/test/libyul/SyntaxTest.h delete mode 100644 compiler/test/libyul/YulInterpreterTest.cpp delete mode 100644 compiler/test/libyul/YulInterpreterTest.h delete mode 100644 compiler/test/libyul/YulOptimizerTest.cpp delete mode 100644 compiler/test/libyul/YulOptimizerTest.h delete mode 100644 compiler/test/libyul/ewasmTranslationTests/address.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/arithmetic_add.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/arithmetic_addmod.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/arithmetic_div.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/arithmetic_exp.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/arithmetic_mod.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/arithmetic_mul.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/arithmetic_mulmod.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/arithmetic_sdiv.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/arithmetic_smod.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/arithmetic_sub.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/balance.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/bitwise_and.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/bitwise_not.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/bitwise_or.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/bitwise_xor.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/blockhash.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/calldatacopy.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/calldataload.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/calldatasize.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/caller.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/callvalue.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/chainid.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/codecopy.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/codesize.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/coinbase.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/comparison_eq.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/comparison_gt.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/comparison_lt.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/comparison_sgt.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/comparison_slt.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/datacopy.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/dataoffset.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/datasize.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/difficulty.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/extcodecopy.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/extcodehash.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/extcodesize.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/gas.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/gaslimit.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/gasprice.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/invalid.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/iszero.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/keccak256.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/log0.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/log1.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/log2.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/log3.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/log4.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/msize.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/mstore8.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/mstore_mload.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/number.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/origin.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/pc.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/return.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/returndatacopy.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/returndatasize.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/revert.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/selfbalance.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/selfdestruct.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/shifts.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/signextend.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/simple_mstore.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/simple_sload.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/simple_sstore.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/smoke.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/smoke_call.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/smoke_callcode.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/smoke_create.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/smoke_create2.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/smoke_delegatecall.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/smoke_staticcall.yul delete mode 100644 compiler/test/libyul/ewasmTranslationTests/timestamp.yul delete mode 100644 compiler/test/libyul/functionSideEffects/cyclic_graph.yul delete mode 100644 compiler/test/libyul/functionSideEffects/doubly_recursive_function.yul delete mode 100644 compiler/test/libyul/functionSideEffects/empty.yul delete mode 100644 compiler/test/libyul/functionSideEffects/empty_with_sstore.yul delete mode 100644 compiler/test/libyul/functionSideEffects/mload_in_function.yul delete mode 100644 compiler/test/libyul/functionSideEffects/multi_calls.yul delete mode 100644 compiler/test/libyul/functionSideEffects/recursive_function.yul delete mode 100644 compiler/test/libyul/functionSideEffects/simple_functions.yul delete mode 100644 compiler/test/libyul/functionSideEffects/structures.yul delete mode 100644 compiler/test/libyul/functionSideEffects/with_loop.yul delete mode 100644 compiler/test/libyul/objectCompiler/data.yul delete mode 100644 compiler/test/libyul/objectCompiler/datacopy.yul delete mode 100644 compiler/test/libyul/objectCompiler/dataoffset_code.yul delete mode 100644 compiler/test/libyul/objectCompiler/dataoffset_data.yul delete mode 100644 compiler/test/libyul/objectCompiler/dataoffset_self.yul delete mode 100644 compiler/test/libyul/objectCompiler/datasize_code.yul delete mode 100644 compiler/test/libyul/objectCompiler/datasize_data.yul delete mode 100644 compiler/test/libyul/objectCompiler/datasize_self.yul delete mode 100644 compiler/test/libyul/objectCompiler/function_series.yul delete mode 100644 compiler/test/libyul/objectCompiler/namedObject.yul delete mode 100644 compiler/test/libyul/objectCompiler/namedObjectCode.yul delete mode 100644 compiler/test/libyul/objectCompiler/nested_optimizer.yul delete mode 100644 compiler/test/libyul/objectCompiler/simple.yul delete mode 100644 compiler/test/libyul/objectCompiler/simple_optimizer.yul delete mode 100644 compiler/test/libyul/objectCompiler/smoke.yul delete mode 100644 compiler/test/libyul/objectCompiler/subObject.yul delete mode 100644 compiler/test/libyul/objectCompiler/subSubObject.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/access_large_memory_offsets.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/ambiguous_vars.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/datacopy.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/dataoffset.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/datasize.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/exp.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/external_call.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/function_calls.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/function_scopes.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/leave.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/leave_for_init.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/loop.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/recursion.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/recursive_function_for_loop.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/shadowed_symbol.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/side_effect_free.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/simple_mstore.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/smoke.yul delete mode 100644 compiler/test/libyul/yulInterpreterTests/switch_statement.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/blockFlattener/basic.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/blockFlattener/for_stmt.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/blockFlattener/if_stmt.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/blockFlattener/many_nested_blocks.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/blockFlattener/switch_stmt.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_for.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_if.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/case2.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/clear_not_needed.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/function_scopes.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/loop.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/movable_functions.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/non_movable_instr.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/non_movable_instr2.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/object_access.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/scopes.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/trivial.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_return.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_variables.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/variable_for_variable.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalSimplifier/clear_after_if_break.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalSimplifier/clear_after_if_continue.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalSimplifier/clear_before_for_condition.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalSimplifier/clear_before_for_post.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalSimplifier/no_opt_if_break_is_not_last.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalSimplifier/no_opt_inside_if.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalSimplifier/opt_after_terminating_if.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalSimplifier/opt_switch.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalSimplifier/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalUnsimplifier/clear_after_if_break.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalUnsimplifier/clear_after_if_continue.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalUnsimplifier/clear_before_for_condition.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalUnsimplifier/clear_before_for_post.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalUnsimplifier/no_opt_if_break_is_not_last.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalUnsimplifier/no_opt_inside_if.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalUnsimplifier/opt_after_terminating_if.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalUnsimplifier/opt_switch.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/conditionalUnsimplifier/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/constantOptimiser/difficult.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/constantOptimiser/gaps.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/constantOptimiser/smallNumbers.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/empty_if_movable_condition.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/empty_if_non_movable_condition.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/remove_leave.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/switch_only_default.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/switch_remove_empty_all.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/switch_remove_empty_case.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/switch_remove_empty_cases.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/switch_remove_empty_default_case.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/switch_to_if.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/terminating_for.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/terminating_for_nested.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/terminating_for_nested_reversed.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/terminating_for_revert.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/terminating_for_revert_plus_break.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/controlFlowSimplifier/terminating_for_with_continue.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/deadCodeEliminator/conditional_break.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/deadCodeEliminator/early_break.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/deadCodeEliminator/early_continue.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/deadCodeEliminator/early_leave.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/deadCodeEliminator/early_revert.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/deadCodeEliminator/early_stop.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/deadCodeEliminator/for_loop_init_decl.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/deadCodeEliminator/function_after_revert.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/deadCodeEliminator/nested_revert.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/deadCodeEliminator/no_removal.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_break.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_continue.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_stop.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/disambiguator/for_statement.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/disambiguator/funtion_call.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/disambiguator/if_statement.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/disambiguator/long_names.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/disambiguator/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/disambiguator/variables.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/multiple_complex.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple_different_vars.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/switch_case_order.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionInliner/argument_duplication_heuristic.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionInliner/complex_with_evm.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionInliner/double_calls.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionInliner/double_recursive_calls.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionInliner/no_inline_mload.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionInliner/simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionInliner/with_args.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/if_condition.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/muli_wrong_order3.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/multi.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/multi_reference.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/multi_wrong_order.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/multi_wrong_order2.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_across_blocks.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition1.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition2.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/only_assignment.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/reassignment.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/single_wrong_order.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/switch_expression.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionJoiner/triple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/assigned_vars_multi.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/combine_shift_and_and.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/combine_shift_and_and_2.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/combine_shift_and_and_3.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/constant_propagation.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/constants.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/create2_and_mask.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/create_and_mask.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_negative.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/including_function_calls.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/inside_for.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/invariant.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/large_byte_access.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_1.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_2.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_arguments.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_names.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_equality_not_movable.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_removes_non_constant_and_not_movable.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/reassign.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/remove_redundant_shift_masking.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/replace_too_large_shift.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/return_vars_zero.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/side_effects_in_for_condition.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/unassigend_vars_multi.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSimplifier/unassigned_vars.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSplitter/control_flow.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSplitter/inside_function.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSplitter/object_access.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSplitter/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSplitter/switch.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/expressionSplitter/trivial.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/forLoopConditionIntoBody/cond_types.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/forLoopConditionIntoBody/empty_body.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/forLoopConditionIntoBody/nested.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/forLoopConditionIntoBody/simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/forLoopInitRewriter/complex_pre.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/forLoopInitRewriter/empty_pre.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/forLoopInitRewriter/nested.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/forLoopInitRewriter/simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/double_inline.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/inside_condition.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/large_function_multi_use.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/large_function_single_use.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/long_names.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/move_up_rightwards_argument.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/multi_fun.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/multi_return.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_function.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_global_context.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/no_inline_leave.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/no_return.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/not_inside_for.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/pop_result.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/recursion.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullInliner/simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/constant_propagation.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/constants.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_negative.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/including_function_calls.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/inside_for.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/invariant.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/mod_and_1.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/mod_and_2.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_arguments.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_names.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_equality_not_movable.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/not_applied_removes_non_constant_and_not_movable.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/operations.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/reversed.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/signextend.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSimplify/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/abi2.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/aztec.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/clear_after_if_continue.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/devcon_example.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/loopInvariantCodeMotion.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/medium.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/no_move_loop_orig.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/remove_redundant_assignments_in_switch.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/reuse_vars_bug_in_simplifier.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/ssaReverse.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/ssaReverseComplex.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/stack_compressor_msize.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/storage.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/switch_inline.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/fullSuite/switch_inline_match_default.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/functionGrouper/already_grouped.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/functionGrouper/empty_block.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/functionGrouper/grouped_but_not_ordered.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/functionGrouper/multi_fun_mixed.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/functionGrouper/nested_fun.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/functionGrouper/single_fun.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/functionGrouper/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/functionHoister/empty_block.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/functionHoister/multi_mixed.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/functionHoister/nested.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/functionHoister/single.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/functionHoister/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/loop.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/memory_with_different_kinds_of_invalidation.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/memory_with_msize.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/merge_known_write.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/merge_known_write_with_distance.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/merge_unknown_write.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/merge_with_rewrite.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/mload_in_function.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_body.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_init.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/re_store_memory.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/re_store_storage.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/reassign.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/reassign_value_expression.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/second_mstore_with_delta.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/second_store.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/second_store_same_value.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/second_store_with_delta.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/side_effects_of_user_functions.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/simple_memory.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loadResolver/staticcall.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loopInvariantCodeMotion/dependOnVarInLoop.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loopInvariantCodeMotion/multi.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loopInvariantCodeMotion/no_move_loop.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loopInvariantCodeMotion/no_move_recursive_function.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loopInvariantCodeMotion/non-ssavar.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loopInvariantCodeMotion/nonMovable.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loopInvariantCodeMotion/recursive.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/loopInvariantCodeMotion/simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/mainFunction/empty_block.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/mainFunction/multi_fun_mixed.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/mainFunction/nested_fun.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/mainFunction/single_fun.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/mainFunction/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/nameDisplacer/funtion_call.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/nameDisplacer/variables.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/nameDisplacer/variables_inside_functions.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/for.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_branch.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_break.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_2.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_3.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_decl_inside_break_continue.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_deep_noremove.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_deep_simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_multi_break.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_nested.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_rerun.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_stmnts_after_break_continue.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/function.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/if.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_overwrite_all_branches.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_used_in_one_branch.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/leave.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/multi_assign.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/multivar.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/non_movable.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/remove_break.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/remove_continue.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/scopes.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_all.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_one.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_use_combination.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_unused.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/branches_for1.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/branches_for2.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/branches_if.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/branches_switch.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/cheap_caller.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/do_not_move_out_of_scope.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/do_remat_large_amounts_of_code_if_used_once.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/for_break.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/for_continue.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/for_continue_2.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/for_continue_with_assignment_in_post.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/large_constant.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/large_constant_used_once.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/many_refs_small_cost_loop.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/medium_sized_constant.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/no_remat_in_loop.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/non_movable_function.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/non_movable_instruction.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/reassign.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/reassignment.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/some_refs_small_cost_loop.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/some_refs_small_cost_nested_loop.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/trivial.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/rematerialiser/update_asignment_remat.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/splitJoin/control_flow.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/splitJoin/functions.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/splitJoin/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaAndBack/for_loop.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_if.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_multi_var_if.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_multi_var_switch.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_switch.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaAndBack/simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_if.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_switch.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaAndBack/ssaReverse.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaAndBack/two_vars.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaPlusCleanup/control_structures.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaPlusCleanup/multi_reassign.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaPlusCleanup/multi_reassign_with_use.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaReverser/abi_example.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaReverser/self_assign.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaReverser/simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/branches.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_body.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_init.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_post.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/for_simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/function.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/multi_assign.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/multi_decl.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/nested.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/nested_reassign.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/notransform.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/switch.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/switch_reassign.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/ssaTransform/used.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/stackCompressor/inlineInBlock.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/stackCompressor/inlineInFunction.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/stackCompressor/noInline.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/stackCompressor/unusedPrunerWithMSize.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/structuralSimplifier/bugfix_visit_after_change.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/structuralSimplifier/for_false_condition.sol delete mode 100644 compiler/test/libyul/yulOptimizerTests/structuralSimplifier/if_false_condition.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/structuralSimplifier/if_multi_unassigned_condition.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/structuralSimplifier/if_true_condition.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/structuralSimplifier/if_unassigned_condition.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/structuralSimplifier/nested.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_match_default.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match_mixed.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/structuralSimplifier/switch_no_remove_empty_case.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/functions.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/intermediate_assignment.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/intermediate_multi_assignment.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/keccak.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/movable_user_defined_function.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/msize.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/multi_assign.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/multi_assignments.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/multi_declarations.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/multi_declare.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/multi_partial_assignments.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/no_msize.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/pop.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/smoke.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/unusedPruner/trivial.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/varDeclInitializer/ambiguous.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/varDeclInitializer/inside_func.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/varDeclInitializer/multi.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/varDeclInitializer/multi_assign.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/varDeclInitializer/simple.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/varNameCleaner/builtins.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/varNameCleaner/function_names.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/varNameCleaner/function_parameters.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/varNameCleaner/function_scopes.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/varNameCleaner/instructions.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/varNameCleaner/name_stripping.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/varNameCleaner/reshuffling-inverse.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/varNameCleaner/reshuffling.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/wordSizeTransform/constant_assignment.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/wordSizeTransform/function_call.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/wordSizeTransform/functional_instruction.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/wordSizeTransform/if.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/wordSizeTransform/or_bool_renamed.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/wordSizeTransform/switch_1.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/wordSizeTransform/switch_2.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/wordSizeTransform/switch_3.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/wordSizeTransform/switch_4.yul delete mode 100644 compiler/test/libyul/yulOptimizerTests/wordSizeTransform/switch_5.yul delete mode 100644 compiler/test/libyul/yulSyntaxTests/simple_functions.yul delete mode 100644 compiler/test/tools/CMakeLists.txt delete mode 100644 compiler/test/tools/IsolTestOptions.cpp delete mode 100644 compiler/test/tools/afl_fuzzer.cpp delete mode 100644 compiler/test/tools/fuzzer_common.cpp delete mode 100644 compiler/test/tools/isoltest.cpp delete mode 100644 compiler/test/tools/ossfuzz/CMakeLists.txt delete mode 100644 compiler/test/tools/ossfuzz/README.md delete mode 100644 compiler/test/tools/ossfuzz/abiV2FuzzerCommon.cpp delete mode 100644 compiler/test/tools/ossfuzz/abiV2FuzzerCommon.h delete mode 100644 compiler/test/tools/ossfuzz/abiV2Proto.proto delete mode 100644 compiler/test/tools/ossfuzz/abiV2ProtoFuzzer.cpp delete mode 100644 compiler/test/tools/ossfuzz/config/solc_noopt_ossfuzz.options delete mode 100644 compiler/test/tools/ossfuzz/config/solc_opt_ossfuzz.options delete mode 100644 compiler/test/tools/ossfuzz/config/solidity.dict delete mode 100644 compiler/test/tools/ossfuzz/config/strict_assembly.dict delete mode 100644 compiler/test/tools/ossfuzz/config/strictasm_assembly_ossfuzz.options delete mode 100644 compiler/test/tools/ossfuzz/config/strictasm_opt_ossfuzz.options delete mode 100644 compiler/test/tools/ossfuzz/protoToAbiV2.cpp delete mode 100644 compiler/test/tools/ossfuzz/protoToAbiV2.h delete mode 100644 compiler/test/tools/ossfuzz/protoToYul.cpp delete mode 100644 compiler/test/tools/ossfuzz/protoToYul.h delete mode 100644 compiler/test/tools/ossfuzz/strictasm_assembly_ossfuzz.cpp delete mode 100644 compiler/test/tools/ossfuzz/strictasm_diff_ossfuzz.cpp delete mode 100644 compiler/test/tools/ossfuzz/yulFuzzerCommon.cpp delete mode 100644 compiler/test/tools/ossfuzz/yulFuzzerCommon.h delete mode 100644 compiler/test/tools/ossfuzz/yulOptimizerFuzzDictionary.h delete mode 100644 compiler/test/tools/ossfuzz/yulProto.proto delete mode 100644 compiler/test/tools/ossfuzz/yulProtoFuzzer.cpp delete mode 100644 compiler/test/tools/ossfuzz/yulProto_diff_ossfuzz.cpp delete mode 100644 compiler/test/tools/yulInterpreter/CMakeLists.txt delete mode 100644 compiler/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp delete mode 100644 compiler/test/tools/yulInterpreter/EVMInstructionInterpreter.h delete mode 100644 compiler/test/tools/yulInterpreter/EwasmBuiltinInterpreter.cpp delete mode 100644 compiler/test/tools/yulInterpreter/EwasmBuiltinInterpreter.h delete mode 100644 compiler/test/tools/yulInterpreter/Interpreter.cpp delete mode 100644 compiler/test/tools/yulInterpreter/Interpreter.h delete mode 100644 compiler/test/tools/yulopti.cpp delete mode 100644 compiler/test/tools/yulrun.cpp delete mode 100644 compiler/test/yulPhaser/Chromosome.cpp delete mode 100644 compiler/test/yulPhaser/Population.cpp delete mode 100644 compiler/test/yulPhaser/Program.cpp delete mode 100644 compiler/test/yulPhaser/Random.cpp create mode 100644 compiler/tools/solidityUpgrade/Upgrade070.cpp create mode 100644 compiler/tools/solidityUpgrade/Upgrade070.h create mode 100644 compiler/tools/yulPhaser/AlgorithmRunner.cpp create mode 100644 compiler/tools/yulPhaser/AlgorithmRunner.h rename compiler/{test/tools/ossfuzz/strictasm_opt_ossfuzz.cpp => tools/yulPhaser/Common.cpp} (50%) create mode 100644 compiler/tools/yulPhaser/Common.h create mode 100644 compiler/tools/yulPhaser/FitnessMetrics.cpp create mode 100644 compiler/tools/yulPhaser/FitnessMetrics.h create mode 100644 compiler/tools/yulPhaser/GeneticAlgorithms.cpp create mode 100644 compiler/tools/yulPhaser/GeneticAlgorithms.h create mode 100644 compiler/tools/yulPhaser/Mutations.cpp create mode 100644 compiler/tools/yulPhaser/Mutations.h create mode 100644 compiler/tools/yulPhaser/PairSelections.cpp create mode 100644 compiler/tools/yulPhaser/PairSelections.h create mode 100644 compiler/tools/yulPhaser/Phaser.cpp create mode 100644 compiler/tools/yulPhaser/Phaser.h create mode 100644 compiler/tools/yulPhaser/ProgramCache.cpp create mode 100644 compiler/tools/yulPhaser/ProgramCache.h create mode 100644 compiler/tools/yulPhaser/README.md delete mode 100644 compiler/tools/yulPhaser/Random.cpp create mode 100644 compiler/tools/yulPhaser/Selections.cpp create mode 100644 compiler/tools/yulPhaser/Selections.h create mode 100644 compiler/tools/yulPhaser/SimulationRNG.cpp create mode 100644 compiler/tools/yulPhaser/SimulationRNG.h create mode 100644 sold/tests/ImportRemote.sol create mode 100644 sold/tests/remote/Remote.sol diff --git a/API.md b/API.md index 444ab980..4a9ed552 100644 --- a/API.md +++ b/API.md @@ -89,7 +89,7 @@ contract development. * [\.operator[]](#bytesoperator) * [\ slice](#bytes-slice) * [\.length](#byteslength) - * [\.toSlice](#bytestoslice) + * [\.toSlice()](#bytestoslice) * [\.dataSize()](#bytesdatasize) * [\.dataSizeQ()](#bytesdatasizeq) * [\.append()](#bytesappend) @@ -101,6 +101,9 @@ contract development. * [\.append()](#stringappend) * [\.operator+](#stringoperator) * [\.find() and \.findLast()](#stringfind-and-stringfindlast) + * [\.toSlice()](#stringtoslice) + * [\.dataSize()](#stringdatasize) + * [\.dataSizeQ()](#stringdatasizeq) * [\.toUpperCase()` and \.toLowerCase()](#stringtouppercase-and-stringtolowercase) * [format()](#format) * [stoi()](#stoi) @@ -1330,7 +1333,7 @@ slice = byteArray[:]; // slice == "01234567890123456789" Returns length of the `bytes` array. -##### \.toSlice +##### \.toSlice() ```TVMSolidity .toSlice() returns (TvmSlice); @@ -1463,6 +1466,30 @@ optional(uint32) c = str.find(sub); bool s = c.hasValue(); // s == false ``` +##### \.toSlice() + +```TVMSolidity +.toSlice() returns (TvmSlice); +``` + +Converts `string` to `TvmSlice`. + +##### \.dataSize() + +```TVMSolidity +.dataSize(uint n) returns (uint /*cells*/, uint /*bits*/, uint /*refs*/); +``` + +Same as [\.dataSize()](#tvmcelldatasize). + +##### \.dataSizeQ() + +```TVMSolidity +.dataSizeQ(uint n) returns (optional(uint /*cells*/, uint /*bits*/, uint /*refs*/)); +``` + +Same as [\.dataSizeQ()](#tvmcelldatasizeq). + ##### \.toUpperCase()` and \.toLowerCase() ```TVMSolidity diff --git a/Cargo.lock b/Cargo.lock index 3e60a089..7949294d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ "gimli", ] @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.19" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] @@ -44,6 +44,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstyle" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80c697cc33851b02ab0c26b2e8a211684fbe627ff1cc506131f35026dd7686dd" + [[package]] name = "arrayref" version = "0.3.6" @@ -58,13 +64,14 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "assert_cmd" -version = "2.0.5" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5c2ca00549910ec251e3bd15f87aeeb206c9456b9a77b43ff6c97c54042a472" +checksum = "c0dcbed38184f9219183fcf38beb4cdbf5df7163a6d7cd227c6ac89b7966d6fe" dependencies = [ - "bstr", + "anstyle", + "bstr 1.3.0", "doc-comment", - "predicates", + "predicates 3.0.1", "predicates-core", "predicates-tree", "wait-timeout", @@ -76,7 +83,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -89,9 +96,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ "addr2line", "cc", @@ -134,54 +141,43 @@ dependencies = [ "constant_time_eq", ] -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.6", + "generic-array", ] [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.6", + "generic-array", ] [[package]] -name = "block-padding" -version = "0.1.5" +name = "bstr" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" dependencies = [ - "byte-tools", + "memchr", ] [[package]] name = "bstr" -version = "0.2.17" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +checksum = "5ffdb39cb703212f3c11973452c2861b972f757b021158f3516ba10f2fa8b2c1" dependencies = [ - "lazy_static", "memchr", + "once_cell", "regex-automata", + "serde", ] [[package]] @@ -192,15 +188,9 @@ checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" [[package]] name = "bumpalo" -version = "3.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" - -[[package]] -name = "byte-tools" -version = "0.3.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "byteorder" @@ -210,9 +200,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cc" -version = "1.0.73" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" dependencies = [ "jobserver", ] @@ -225,9 +215,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.22" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" dependencies = [ "iana-time-zone", "js-sys", @@ -255,14 +245,14 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.18" +version = "4.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b" +checksum = "c3d7ae14b20b94cb02149ed21a86c423859cbe18dc7ed69845cace50e52b40a5" dependencies = [ - "atty", "bitflags", "clap_derive", "clap_lex", + "is-terminal", "once_cell", "strsim 0.10.0", "termcolor", @@ -270,9 +260,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.18" +version = "4.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16a1b0f6422af32d5da0c58e2703320f379216ee70198241c84173a8c5ac28f3" +checksum = "44bec8e5c9d09e439c4335b1af0abaab56dcf3b94999a936e1bb47b9134288f0" dependencies = [ "heck", "proc-macro-error", @@ -283,18 +273,18 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +checksum = "350b9cf31731f9957399229e9b2adc51eeabdfbe9d71d9a0552275fd12710d09" dependencies = [ "os_str_bytes", ] [[package]] name = "cmake" -version = "0.1.48" +version = "0.1.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" dependencies = [ "cc", ] @@ -341,24 +331,24 @@ dependencies = [ [[package]] name = "crc" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0165d2900ae6778e36e80bbc4da3b5eefccee9ba939761f9c2882a5d9af3ff" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" [[package]] name = "crossbeam-utils" -version = "0.8.12" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" dependencies = [ "cfg-if", ] @@ -369,7 +359,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.6", + "generic-array", "typenum", ] @@ -388,9 +378,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.80" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" +checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72" dependencies = [ "cc", "cxxbridge-flags", @@ -400,9 +390,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.80" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" +checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613" dependencies = [ "cc", "codespan-reporting", @@ -415,15 +405,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.80" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" +checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97" [[package]] name = "cxxbridge-macro" -version = "1.0.80" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" +checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" dependencies = [ "proc-macro2", "quote", @@ -445,31 +435,22 @@ dependencies = [ "ansi_term", ] -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", -] - [[package]] name = "digest" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.6", + "generic-array", ] [[package]] name = "digest" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ - "block-buffer 0.10.3", + "block-buffer 0.10.4", "crypto-common", ] @@ -498,9 +479,9 @@ checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c" [[package]] name = "ed25519" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ "signature", ] @@ -521,9 +502,30 @@ dependencies = [ [[package]] name = "either" -version = "1.8.0" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "errno" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] [[package]] name = "failure" @@ -547,12 +549,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - [[package]] name = "float-cmp" version = "0.9.0" @@ -562,15 +558,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.6" @@ -605,15 +592,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -624,6 +611,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "hex" version = "0.3.2" @@ -638,9 +631,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "iana-time-zone" -version = "0.1.51" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -660,6 +653,28 @@ dependencies = [ "cxx-build", ] +[[package]] +name = "io-lifetimes" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfa919a82ea574332e2de6e74b4c36e74d41982b335080fa59d4ef31be20fdf3" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "is-terminal" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys", +] + [[package]] name = "itertools" version = "0.10.5" @@ -671,24 +686,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "jobserver" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" dependencies = [ "wasm-bindgen", ] @@ -701,19 +716,25 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.136" +version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55edcf6c0bb319052dea84732cf99db461780fd5e8d3eb46ab6ff312ab31f197" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "link-cplusplus" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" dependencies = [ "cc", ] +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + [[package]] name = "lockfree" version = "0.5.1" @@ -739,9 +760,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "miniz_oxide" -version = "0.5.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] @@ -779,9 +800,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" +checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" dependencies = [ "num-traits", ] @@ -841,24 +862,18 @@ dependencies = [ [[package]] name = "object" -version = "0.29.0" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.15.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" - -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "opaque-debug" @@ -868,9 +883,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "os_str_bytes" -version = "6.3.0" +version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" [[package]] name = "owned-alloc" @@ -878,17 +893,23 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30fceb411f9a12ff9222c5f824026be368ff15dc2f13468d850c7d3f502205d6" +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "predicates" -version = "2.1.1" +version = "2.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5aab5be6e4732b473071984b3164dbbfb7a3674d30ea5ff44410b6bcd960c3c" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" dependencies = [ "difflib", "float-cmp", @@ -898,17 +919,29 @@ dependencies = [ "regex", ] +[[package]] +name = "predicates" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba7d6ead3e3966038f68caa9fc1f860185d95a793180bbcfe0d0da47b3961ed" +dependencies = [ + "anstyle", + "difflib", + "itertools", + "predicates-core", +] + [[package]] name = "predicates-core" -version = "1.0.3" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da1c2388b1513e1b605fcec39a95e0a9e8ef088f71443ef37099fa9ae6673fcb" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" [[package]] name = "predicates-tree" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d86de6de25020a36c6d3643a86d9a6a9f552107c0559c60ea03551b5e16c032" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" dependencies = [ "predicates-core", "termtree", @@ -940,18 +973,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.21" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -1046,9 +1079,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", "memchr", @@ -1063,9 +1096,9 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "rust-argon2" @@ -1085,32 +1118,46 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +[[package]] +name = "rustix" +version = "0.36.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys", +] + [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "scratch" -version = "1.0.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "serde" -version = "1.0.147" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.147" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" dependencies = [ "proc-macro2", "quote", @@ -1119,27 +1166,15 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.87" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" dependencies = [ "itoa", "ryu", "serde", ] -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - [[package]] name = "sha2" version = "0.9.9" @@ -1150,7 +1185,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug", ] [[package]] @@ -1161,7 +1196,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.5", + "digest 0.10.6", ] [[package]] @@ -1172,11 +1207,11 @@ checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" [[package]] name = "similar" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ac7f900db32bf3fd12e0117dd3dc4da74bc52ebaac97f39668446d89694803" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" dependencies = [ - "bstr", + "bstr 0.2.17", ] [[package]] @@ -1198,16 +1233,16 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "sold" -version = "0.66.0" +version = "0.67.0" dependencies = [ "assert_cmd", "atty", - "clap 4.0.18", + "clap 4.1.8", "cmake", "dunce", "failure", "once_cell", - "predicates", + "predicates 2.1.5", "serde", "serde_json", "strip-ansi-escapes", @@ -1240,15 +1275,15 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "1.0.103" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -1280,18 +1315,18 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] [[package]] name = "termtree" -version = "0.2.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507e9898683b6c43a9aa55b64259b721b52ba226e0f3779137e50ad114a4c90b" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "textwrap" @@ -1304,9 +1339,9 @@ dependencies = [ [[package]] name = "time" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", @@ -1315,8 +1350,8 @@ dependencies = [ [[package]] name = "ton_abi" -version = "2.3.7" -source = "git+https://github.com/tonlabs/ton-labs-abi.git?tag=2.3.7#958fba895b3a7c4f255d89a0f292e2136350022c" +version = "2.3.60" +source = "git+https://github.com/tonlabs/ton-labs-abi.git?tag=2.3.60#2b595a53e0c844c1cd4eaf2faa167de31909dd3c" dependencies = [ "base64 0.10.1", "byteorder", @@ -1330,18 +1365,18 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "sha2 0.8.2", + "sha2 0.10.6", "ton_block", "ton_types", ] [[package]] name = "ton_block" -version = "1.8.3" -source = "git+https://github.com/tonlabs/ton-labs-block.git?tag=1.8.3#19a77eb0cccf6dc097ac934458976e1e91402ade" +version = "1.9.22" +source = "git+https://github.com/tonlabs/ton-labs-block.git?tag=1.9.22#bb1f4af6072e52618bdffcfa7614e8ca6ee6b947" dependencies = [ "base64 0.13.1", - "crc 3.0.0", + "crc 3.0.1", "ed25519", "ed25519-dalek", "failure", @@ -1355,8 +1390,8 @@ dependencies = [ [[package]] name = "ton_labs_assembler" -version = "1.2.49" -source = "git+https://github.com/tonlabs/ton-labs-assembler.git?tag=1.2.49#3402cd94fe15dfc249acbf891d40a41fface87c3" +version = "1.2.77" +source = "git+https://github.com/tonlabs/ton-labs-assembler.git?tag=1.2.77#6257a674457627646237e74ee6eb402f052d214f" dependencies = [ "failure", "hex 0.4.3", @@ -1370,8 +1405,8 @@ dependencies = [ [[package]] name = "ton_types" -version = "1.11.4" -source = "git+https://github.com/tonlabs/ton-labs-types.git?tag=1.11.4#7f0063faa486298ba57ceb97e1d6e38447d6e0e3" +version = "1.12.6" +source = "git+https://github.com/tonlabs/ton-labs-types.git?tag=1.12.6#8e218813db6bacc138dbbec7ab4ccbf84220da31" dependencies = [ "base64 0.13.1", "crc 1.8.1", @@ -1390,8 +1425,8 @@ dependencies = [ [[package]] name = "ton_vm" -version = "1.8.44" -source = "git+https://github.com/tonlabs/ton-labs-vm.git?tag=1.8.44#5a83076b448cb35d2da7611552f76dea5cffc9db" +version = "1.8.108" +source = "git+https://github.com/tonlabs/ton-labs-vm.git?tag=1.8.108#f61649a6245fc8002a5a20062de75f49b5203652" dependencies = [ "diffy", "ed25519", @@ -1403,7 +1438,7 @@ dependencies = [ "num", "num-traits", "rand 0.7.3", - "sha2 0.9.9", + "sha2 0.10.6", "similar", "ton_block", "ton_types", @@ -1412,12 +1447,12 @@ dependencies = [ [[package]] name = "tvm_linker" -version = "0.18.4" -source = "git+https://github.com/tonlabs/TVM-linker.git?tag=0.18.4#4e97449a48c05600af00027d652519de61190b53" +version = "0.19.5" +source = "git+https://github.com/tonlabs/TVM-linker.git?tag=0.19.5#5171e981fa892932a8a802f9d2fd937ea6a483a7" dependencies = [ "base64 0.13.1", "clap 2.34.0", - "crc 3.0.0", + "crc 3.0.1", "ed25519", "ed25519-dalek", "failure", @@ -1441,15 +1476,15 @@ dependencies = [ [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" [[package]] name = "unicode-width" @@ -1465,9 +1500,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "utf8parse" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "vec_map" @@ -1531,9 +1566,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1541,9 +1576,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", "log", @@ -1556,9 +1591,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1566,9 +1601,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", @@ -1579,9 +1614,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "winapi" @@ -1614,6 +1649,72 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "zeroize" version = "1.3.0" @@ -1625,9 +1726,9 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" +checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ "proc-macro2", "quote", @@ -1656,10 +1757,11 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.1+zstd.1.5.2" +version = "2.0.7+zstd.1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" +checksum = "94509c3ba2fe55294d752b79842c530ccfab760192521df74a081a78d2b3c7f5" dependencies = [ "cc", "libc", + "pkg-config", ] diff --git a/Changelog_TON.md b/Changelog_TON.md index 4c1e2d8c..864a69d4 100644 --- a/Changelog_TON.md +++ b/Changelog_TON.md @@ -1,3 +1,14 @@ +### 0.67.0 (2023-03-16) + +Update compiler frontend (from original version 0.6.3 to 0.8.17): + * Breaking changes: + * `block.timestamp` returns opcode `NOW` instead of opcode `BLOCKLT`. `block.logicaltime` returns opcode `BLOCKLT`. + * Type `byte` is deleted. Use `bytes1`. + * And another breaking changes from original compiler. + * Files are imported according [this](https://docs.soliditylang.org/en/v0.8.17/path-resolution.html). Use cmd options `--base-path`, `--include-path` and another options. + * Downloading files in import section from the Internet is forbidden. Use [remapping](https://docs.soliditylang.org/en/v0.8.17/path-resolution.html#import-remapping). + * Update NatSpec, code analyzer, etc. + ### 0.66.0 (2022-10-25) Bugfixes: diff --git a/README.md b/README.md index f45bf53c..e82b4726 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![GitHub](https://img.shields.io/github/license/tonlabs/TON-Solidity-Compiler?style=for-the-badge)](./LICENSE) [![Everscale](https://custom-icon-badges.demolab.com/badge/-everscale-13173e?style=for-the-badge&logoColor=yellow&logo=everscale)](https://everscale.network/) + Port of the Solidity smart-contract [compiler](https://github.com/ethereum/solidity) generating TVM bytecode for TON blockchain. Please refer to upstream README.md for information on the language itself. ## TON Solidity API reference @@ -26,7 +27,7 @@ Original Instructions about how to build and install the Solidity compiler can b ### Ubuntu Linux ```shell -git clone git@github.com:tonlabs/TON-Solidity-Compiler.git +git clone https://github.com/tonlabs/TON-Solidity-Compiler cd TON-Solidity-Compiler sh ./compiler/scripts/install_deps.sh mkdir build @@ -43,20 +44,20 @@ sh ./compiler/scripts/install_lib_variable.sh ### Windows 10 -Install Visual Studio, Git bash, cmake. -Run Visual Studio Developer Command Prompt +Install Visual Studio Build Tools 2019, Git bash, cmake. +Run Developer PowerShell for VS 2019 ```shell git clone https://github.com/tonlabs/TON-Solidity-Compiler cd TON-Solidity-Compiler -cmake -P compiler\scripts\install_deps.cmake +compiler\scripts\install_deps.ps1 mkdir build cd build -cmake ..\compiler -cmake --build . --config Release -j 8 +cmake -DBoost_DIR="..\compiler\deps\boost\lib\cmake\Boost-1.77.0" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded ..\compiler +cmake --build . --config Release -- /m ``` -To facilitate work with other TON tools add path to stdlib_sol.tvm into environment variable TVM_LINKER_LIB_PATH. +To facilitate work with other TON tools add path to stdlib_sol.tvm into environment variable `TVM_LINKER_LIB_PATH`. ## Sold driver diff --git a/compiler/.clang-format b/compiler/.clang-format new file mode 100644 index 00000000..edd5de4d --- /dev/null +++ b/compiler/.clang-format @@ -0,0 +1,41 @@ +# Formatting approximately used in Solidity's C++ +# +# See https://clang.llvm.org/docs/ClangFormatStyleOptions.html +# For an online formatter to test settings, see +# https://zed0.co.uk/clang-format-configurator/ +# Note that clang-format cannot express the style that closing parentheses +# behave similar to closing curly braces in a multi-line setting in that +# they have to be on a line of their own at the same indentation level +# as the opening part (aka "dangling parenthesis", see https://reviews.llvm.org/D33029). + +Language: Cpp +BasedOnStyle: LLVM +AccessModifierOffset: -4 +AlignAfterOpenBracket: AlwaysBreak +AlignEscapedNewlinesLeft: true +AlwaysBreakAfterReturnType: None +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: false +BinPackParameters: false +BreakBeforeBinaryOperators: All +BreakBeforeBraces: Allman +ColumnLimit: 120 +ContinuationIndentWidth: 4 +FixNamespaceComments: false +IndentWidth: 4 +KeepEmptyLinesAtTheStartOfBlocks: false +MaxEmptyLinesToKeep: 2 +PenaltyBreakBeforeFirstCallParameter: 2000 +PointerAlignment: Left +SpaceAfterCStyleCast: true +SpaceAfterTemplateKeyword: false +SpaceBeforeCtorInitializerColon: false +SpaceBeforeInheritanceColon: false +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: false +TabWidth: 4 +UseTab: Always + +# Local Variables: +# mode: yaml +# End: diff --git a/compiler/.editorconfig b/compiler/.editorconfig new file mode 100644 index 00000000..0bb3fce2 --- /dev/null +++ b/compiler/.editorconfig @@ -0,0 +1,23 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{cpp,h}] +indent_style = tab +indent_size = 4 + +[*.{py,rst,sh,yml}] +indent_style = space +indent_size = 4 + +[*.{sol,yul}] +indent_style = space +indent_size = 4 + +[*.{txt,cmake,json}] +indent_style = tab +indent_size = 4 diff --git a/compiler/.gitignore b/compiler/.gitignore index af53701e..4f171718 100644 --- a/compiler/.gitignore +++ b/compiler/.gitignore @@ -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,9 +21,6 @@ prerelease.txt *.dylib *.dll -# Fortran module files -*.mod - # Compiled Static libraries *.lai *.la @@ -31,25 +33,29 @@ prerelease.txt *.app # Build directory -build*/ -cmake-build-*/ -docs/_build -docs/utils/__pycache__ -docs/utils/*.pyc -/deps/downloads/ -deps/install -deps/cache +/build* +emscripten_build/ +/docs/_build +/docs/_static/robots.txt +/deps # vim stuff [._]*.sw[a-p] [._]sw[a-p] +# emacs stuff +*~ + # IDE files -.idea -.vscode -browse.VC.db -CMakeLists.txt.user +/.idea/ +/.vscode/ +/browse.VC.db +/CMakeLists.txt.user /CMakeSettings.json /.vs /.cproject /.project + +# OS specific local files +.DS_Store +Thumbs.db diff --git a/compiler/.travis.yml b/compiler/.travis.yml deleted file mode 100644 index c91daada..00000000 --- a/compiler/.travis.yml +++ /dev/null @@ -1,247 +0,0 @@ -#------------------------------------------------------------------------------ -# TravisCI configuration file for solidity. -# -# The documentation for solidity is hosted at: -# -# http://solidity.readthedocs.org -# -# ------------------------------------------------------------------------------ -# 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 -# -# (c) 2016-2017 solidity contributors. -#------------------------------------------------------------------------------ - -language: cpp - -branches: - # We need to whitelist the branches which we want to have "push" automation, - # this includes tags (which are treated as branches by travis). - # Pull request automation is not constrained to this set of branches. - only: - - develop - - release - - /^v[0-9]/ - -env: - global: - - ENCRYPTION_LABEL="6d4541b72666" - - SOLC_BUILD_TYPE=RelWithDebInfo - - SOLC_EMSCRIPTEN=Off - - SOLC_INSTALL_DEPS_TRAVIS=On - - SOLC_RELEASE=On - - SOLC_TESTS=On - - SOLC_STOREBYTECODE=Off - - SOLC_DOCKER=Off - -matrix: - include: - - os: linux - dist: trusty - sudo: required - compiler: gcc - env: - - ZIP_SUFFIX=ubuntu-trusty - - SOLC_STOREBYTECODE=On - before_install: - - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - - sudo add-apt-repository -y ppa:mhier/libboost-latest - - sudo apt-get update -qq - install: - - sudo apt-get install -qq g++-8 gcc-8 - - sudo apt-get install -qq libboost1.67-dev - - sudo apt-get install -qq libleveldb1 - - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 90 - - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 90 - - - os: linux - dist: trusty - sudo: required - compiler: clang - env: - - ZIP_SUFFIX=ubuntu-trusty-clang - - SOLC_STOREBYTECODE=On - before_install: - - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - - sudo add-apt-repository -y ppa:mhier/libboost-latest - - sudo apt-get update -qq - install: - - sudo apt-get install -qq g++-8 gcc-8 - - sudo apt-get install -qq libboost1.67-dev - - sudo apt-get install -qq libleveldb1 - - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 90 - - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 90 - - # Docker target, which generates a statically linked alpine image - - os: linux - dist: trusty - sudo: required - services: - - docker - env: - - SOLC_DOCKER=On - - SOLC_INSTALL_DEPS_TRAVIS=Off - - SOLC_RELEASE=Off - - SOLC_TESTS=Off - - # Emscripten target, which compiles 'solc' to javascript and uploads the resulting .js - # files to https://github.com/ethereum/solc-bin. These binaries are used in Browser-Solidity - # and in other Ethereum web-based development contexts. - - os: linux - dist: trusty - sudo: required - compiler: gcc - node_js: - - "8" - services: - - docker - before_install: - - nvm install 8 - - nvm use 8 - - docker pull trzeci/emscripten:sdk-tag-1.38.22-64bit - env: - - SOLC_EMSCRIPTEN=On - - SOLC_INSTALL_DEPS_TRAVIS=Off - - SOLC_RELEASE=Off - - SOLC_TESTS=Off - - ZIP_SUFFIX=emscripten - - SOLC_STOREBYTECODE=On - # Travis doesn't seem to support "dynamic" cache keys where we could include - # the hashes of certain files. Our CircleCI configuration contains the hash of - # relevant emscripten files. - # - # It is important to invalidate the cache with each emscripten update, because - # dependencies, such as boost, might be broken otherwise. - # - # This key here has no significant on anything, apart from caching. Please keep - # it in sync with the version above. - - EMSCRIPTEN_VERSION_KEY="1.38.22" - - # OS X Mavericks (10.9) - # https://en.wikipedia.org/wiki/OS_X_Mavericks - # -# Disabled because of problems on travis. -# - os: osx -# osx_image: beta-xcode6.2 -# env: -# - ZIP_SUFFIX=osx-mavericks - - # OS X Yosemite (10.10) - # https://en.wikipedia.org/wiki/OS_X_Yosemite - # -# - os: osx -# osx_image: xcode7.1 -# env: -# # Workaround for "macOS - Yosemite, El Capitan and Sierra hanging?" -# # https://github.com/ethereum/solidity/issues/894 -# - SOLC_TESTS=Off -# - ZIP_SUFFIX=osx-yosemite - - # OS X El Capitan (10.11) - # https://en.wikipedia.org/wiki/OS_X_El_Capitan - # -# - os: osx -# osx_image: xcode7.3 -# env: -# # The use of Debug config here ONLY for El Capitan is a workaround for "The Heisenbug" -# # See https://github.com/ethereum/webthree-umbrella/issues/565 -# - SOLC_BUILD_TYPE=Debug -# # Workaround for "macOS - Yosemite, El Capitan and Sierra hanging?" -# # https://github.com/ethereum/solidity/issues/894 -# - SOLC_TESTS=Off -# - ZIP_SUFFIX=osx-elcapitan - - # macOS Sierra (10.12) - # https://en.wikipedia.org/wiki/MacOS_Sierra - # -# - os: osx -# osx_image: xcode8 -# env: -# # Look like "The Heisenbug" is occurring here too, so we'll do the same workaround. -# # See https://travis-ci.org/ethereum/solidity/jobs/150240930 -# - SOLC_BUILD_TYPE=Debug -# # Workaround for "macOS - Yosemite, El Capitan and Sierra hanging?" -# # https://github.com/ethereum/solidity/issues/894 -# - SOLC_TESTS=Off -# - ZIP_SUFFIX=macos-sierra - -git: - depth: 2 - -cache: - ccache: true - directories: - - boost_1_68_0 - - $HOME/.local - -install: - - test $SOLC_INSTALL_DEPS_TRAVIS != On || (scripts/install_deps.sh) - - test "$TRAVIS_OS_NAME" != "linux" || (scripts/install_cmake.sh) - -before_script: - # Disable tests unless run on the release branch, on tags or with daily cron - - if [ "$TRAVIS_BRANCH" != release -a -z "$TRAVIS_TAG" -a "$TRAVIS_EVENT_TYPE" != cron ]; then SOLC_TESTS=Off; fi - - if [ "$TRAVIS_BRANCH" = release -o -n "$TRAVIS_TAG" ]; then echo -n > prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" > prerelease.txt; fi - - echo -n "$TRAVIS_COMMIT" > commit_hash.txt - - test $SOLC_EMSCRIPTEN != On || (scripts/build_emscripten.sh) - - test $SOLC_DOCKER != On || (scripts/docker_build.sh) - - test $SOLC_RELEASE != On || (scripts/build.sh $SOLC_BUILD_TYPE -DBoost_USE_STATIC_LIBS=OFF && scripts/create_source_tarball.sh) - -script: - - test $SOLC_EMSCRIPTEN != On -o $SOLC_TESTS != On || (scripts/test_emscripten.sh) - - test $SOLC_TESTS != On || (cd $TRAVIS_BUILD_DIR && scripts/tests.sh) - - test $SOLC_STOREBYTECODE != On || (cd $TRAVIS_BUILD_DIR && scripts/bytecodecompare/storebytecode.sh) - -deploy: - # This is the deploy target for the Emscripten build. - # It publishes the JS file which was compiled as part of the earlier 'build_emscripten.sh' - # step to https://github.com/ethereum/solc-bin/tree/gh-pages/bin. - # Both the build and deploy steps for Emscripten are only run within the Ubuntu - # configurations (not for macOS). That is controlled by conditionals within the bash - # scripts because TravisCI doesn't provide much in the way of conditional logic. - - - provider: script - script: test $SOLC_EMSCRIPTEN != On || (scripts/release_emscripten.sh) - skip_cleanup: true - on: - branch: - - develop - - release - # This is the deploy target for the dockerfile. If we are pushing into a develop branch, it will be tagged - # as a nightly and appended the commit of the branch it was pushed in. If we are pushing to master it will - # be tagged as "stable" and given the version tag as well. - - provider: script - script: test $SOLC_DOCKER != On || (scripts/docker_deploy.sh) - skip_cleanup: true - on: - branch: - - develop - - release - - /^v\d/ - # This is the deploy target for the native build (Linux and macOS) - # which generates the source tarball. - # - # This runs for each tag that is created and adds the corresponding files. - - provider: releases - api_key: - secure: PWH37xVBCF0XiSjl+eH7XIdkrfxZXjzvqF4PiBOnD3VnFz+odrdnIwBmCeBYTHTWF8efpp8fmzWJk2UVq1JcpyZiC+SVxO8dx91W2ia1a+wKrEQuDgkUrZBkl5IQNCv0QS81DDQhliyZEaYh8wHO/7RReyMpGpw2U2u85WkFiZ+LdlHEZPfzUeh9lxQ9n8qwFL8Rja+Q05d4cQ8zaVEtofJJT4T6DUWhc3TzuxDYxOmjwg37rC9CkGSLn6VadSh8b3j5R0SZupFsAEvBL/imBLP9r9ewoo7o4p6By3jwiIgH9yNg7LM618xbffcNaYF/KtLBi9uPHfqF7hRD4PlECz+D0PR78nQItOX5HKm1QMg5kCnghRVCA0IVjpV5fiYQnMLM7dCRv34I5b3zLpa69wQ/GLYB2FViqNUfvPeiZTEeIJ2OmATlFx8AH2JoqpY1XJknWb35+vMfa8LSiJJW++SLWeV+ncC92hrvyZ1cy3trepRRZIfyYepxHifnfdWMkddQUJk5b2WS5Fy/TJLZNPeombnpvRhUC38dsYItarKeXTc6k4oADCEDZ2rgGIcEiqRxXV11Y5xHJekLDWzUs+YJNcCuL4pnAP//LOnbnH2w9rLpwhQYSl0anCd097NivAXQJXO2JI/byIYz1kiCVQWnW6EM8+72mLOklf/Qr8k= - - overwrite: true - file_glob: true - file: $TRAVIS_BUILD_DIR/upload/* - skip_cleanup: true - on: - all_branches: true - tags: true diff --git a/compiler/CMakeLists.txt b/compiler/CMakeLists.txt index dfd31eeb..f78099a4 100644 --- a/compiler/CMakeLists.txt +++ b/compiler/CMakeLists.txt @@ -1,8 +1,19 @@ -cmake_minimum_required(VERSION 3.9.0) +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") 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") + set(DEFAULT_BUILD_TYPE "RelWithDebInfo") + else() + set(DEFAULT_BUILD_TYPE "Release") + endif() + set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo" "MinSizeRel") +endif() + include(EthToolchains) # Set cmake_policies @@ -10,7 +21,9 @@ include(EthPolicy) eth_policy() # project name and version should be set after cmake_policy CMP0048 -set(PROJECT_VERSION "0.66.0") +set(PROJECT_VERSION "0.67.0") +# OSX target needed in order to support std::visit +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14") project(solidity VERSION ${PROJECT_VERSION} LANGUAGES C CXX) include(TestBigEndian) @@ -21,17 +34,25 @@ endif() option(SOLC_LINK_STATIC "Link solc executable statically on supported platforms" OFF) option(WITH_TESTS "Run solc tests" 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) # Setup cccache. include(EthCcache) # Let's find our dependencies include(EthDependencies) +include(fmtlib) include(jsoncpp) +include(range-v3) 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() # Figure out what compiler and system are we using include(EthCompilerSettings) @@ -49,6 +70,8 @@ configure_file("${CMAKE_SOURCE_DIR}/cmake/templates/license.h.in" include/licens include(EthOptions) configure_project(TESTS) +set(LATEST_Z3_VERSION "4.11.0") +set(MINIMUM_Z3_VERSION "4.8.0") add_subdirectory(libsolutil) add_subdirectory(liblangutil) @@ -58,7 +81,6 @@ if (WITH_TESTS) add_subdirectory(test2) endif() - if (NOT EMSCRIPTEN) add_subdirectory(solc) endif() diff --git a/compiler/CODING_STYLE.md b/compiler/CODING_STYLE.md index 6bdb48fb..674c2add 100644 --- a/compiler/CODING_STYLE.md +++ b/compiler/CODING_STYLE.md @@ -81,7 +81,7 @@ tuple myNamespace::meanAndSigma(vector const& _v) - Copyright - License (e.g. see COPYING) 2. Never use `#ifdef`/`#define`/`#endif` file guards. Prefer `#pragma` once as first line below file comment. -3. Prefer static const variable to value macros. +3. Prefer static constexpr variables to value macros. 4. Prefer inline constexpr functions to function macros. 5. Split complex macro on multiple lines with `\`. @@ -141,7 +141,7 @@ struct MeanSigma double const d = 0; int i = 0; int j = 0; -char* s; +char* s = nullptr; MeanAndSigma ms meanAndSigma(std::vector const& _v, Accuracy _a); Derived* x = dynamic_cast(base); for (auto i = x->begin(); i != x->end(); ++i) {} @@ -236,7 +236,7 @@ Example: #include ``` -See [this issue](http://stackoverflow.com/questions/614302/c-header-order/614333#614333 "C header order") for the reason: this makes it easier to find missing includes in header files. +See [this issue](https://stackoverflow.com/questions/614302/c-header-order/614333#614333 "C header order") for the reason: this makes it easier to find missing includes in header files. ## 13. Recommended reading diff --git a/compiler/CONTRIBUTING.md b/compiler/CONTRIBUTING.md index 2b591f4e..e071a229 100644 --- a/compiler/CONTRIBUTING.md +++ b/compiler/CONTRIBUTING.md @@ -1,5 +1,5 @@ # Contribution Guidelines -Please see our contribution guidelines in [the Solidity documentation](http://solidity.readthedocs.io/en/latest/contributing.html). +Please see our contribution guidelines in [the Solidity documentation](https://docs.soliditylang.org/en/latest/contributing.html). Thank you for your help! diff --git a/compiler/Changelog.md b/compiler/Changelog.md index 9bde3fff..2167d5b7 100644 --- a/compiler/Changelog.md +++ b/compiler/Changelog.md @@ -1,18 +1,1042 @@ -### 0.6.3 (unreleased) +### 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: + * General: Add equality-comparison operators for external function types. + * General: Support ``ContractName.functionName`` for ``abi.encodeCall``, in addition to external function pointers. + + +Compiler Features: + * Commandline Interface: Event and error signatures are also returned when using ``--hashes``. + * Yul Optimizer: Remove ``mstore`` and ``sstore`` operations if the slot already contains the same value. + * Yul: Emit immutable references for pure yul code when requested. + + + +Bugfixes: + * Antlr Grammar: Allow builtin names in ``yulPath`` to support ``.address`` in function pointers. + * Code Generator: Fix internal error when accessing the members of external functions occupying more than two stack slots. + * Code Generator: Fix internal error when doing an explicit conversion from ``string calldata`` to ``bytes``. + * Control Flow Graph: Perform proper virtual lookup for modifiers for uninitialized variable and unreachable code analysis. + * General: ``string.concat`` now properly takes strings as arguments and returns ``string memory``. It was accidentally introduced as a copy of ``bytes.concat`` before. + * Immutables: Fix wrong error when the constructor of a base contract uses ``return`` and the derived contract contains immutable variables. + * Inheritance: Consider functions in all ancestors during override analysis. + * IR Generator: Add missing cleanup during the conversion of fixed bytes types to smaller fixed bytes types. + * IR Generator: Add missing cleanup for indexed event arguments of value type. + * IR Generator: Fix internal error when copying reference types in calldata and storage to struct or array members in memory. + * IR Generator: Fix IR syntax error when copying storage arrays of structs containing functions. + * Natspec: Fix internal error when overriding a struct getter with a Natspec-documented return value and the name in the struct is different. + * Type Checker: Fix internal error when a constant variable declaration forward references a struct. + * Yul EVM Code Transform: Improved stack shuffling in corner cases. + + +Solc-Js: + * The wrapper now requires at least nodejs v10. + * The code has been ported to TypeScript. + + +Build System: + * Emscripten builds store the embedded WebAssembly binary in LZ4 compressed format and transparently decompress on loading. + + +### 0.8.11 (2021-12-20) + +Language Features: + * General: New builtin function ``abi.encodeCall(functionPointer, (arg1, arg2, ...))`` that type-checks the arguments and returns the ABI-encoded function call data. + + +Compiler Features: + * Commandline Interface: Add ``--lsp`` option to get ``solc`` to act as a Language Server (LSP) communicating over stdio. + + +Bugfixes: + * Code Generator: Fix a crash when using ``@use-src`` and compiling from Yul to ewasm. + * SMTChecker: Fix internal error when an unsafe target is solved more than once and the counterexample messages are different. + * SMTChecker: Fix soundness of assigned storage/memory local pointers that were not erasing enough knowledge. + * Fix internal error when a function has a calldata struct argument with an internal type inside. + * IR Generator: Fix IR syntax error when copying storage arrays of functions. + + +### 0.8.10 (2021-11-09) + +Language Features: + * Inline Assembly: Support ``.address`` and ``.selector`` on external function pointers to access their address and function selector. + + +Compiler Features: + * Code Generator: Skip existence check for external contract if return data is expected. In this case, the ABI decoder will revert if the contract does not exist. + * Commandline Interface: Accept nested brackets in step sequences passed to ``--yul-optimizations``. + * Commandline Interface: Add ``--debug-info`` option for selecting how much extra debug information should be included in the produced EVM assembly and Yul code. + * Commandline Interface: Support ``--asm``, ``--bin``, ``--ir-optimized``, ``--ewasm`` and ``--ewasm-ir`` output selection options in assembler mode. + * Commandline Interface: Use different colors when printing errors, warnings and infos. + * JSON AST: Set absolute paths of imports earlier, in the ``parsing`` stage. + * SMTChecker: Output values for ``block.*``, ``msg.*`` and ``tx.*`` variables that are present in the called functions. + * SMTChecker: Report contract invariants and reentrancy properties. This can be enabled via the CLI option ``--model-checker-invariants`` or the Standard JSON option ``settings.modelChecker.invariants``. + * Standard JSON: Accept nested brackets in step sequences passed to ``settings.optimizer.details.yulDetails.optimizerSteps``. + * Standard JSON: Add ``settings.debug.debugInfo`` option for selecting how much extra debug information should be included in the produced EVM assembly and Yul code. + * Yul EVM Code Transform: Switch to new optimized code transform when compiling via Yul with enabled optimizer. + * Yul Optimizer: Take control-flow side-effects of user-defined functions into account in various optimizer steps. + + +Bugfixes: + * Code Generator: Fix constructor source mappings for immutables. + * Commandline Interface: Disallow ``--error-recovery`` option outside of the compiler mode. + * Commandline Interface: Don't return zero exit code when writing linked files to disk fails. + * Commandline Interface: Fix extra newline character being appended to sources passed through standard input, affecting their hashes. + * Commandline Interface: Report output selection options unsupported by the selected input mode instead of ignoring them. + * Commandline Interface: When linking only accept exact matches for library names passed to the ``--libraries`` option. Library names not prefixed with a file name used to match any library with that name. + * SMTChecker: Fix internal error in magic type access (``block``, ``msg``, ``tx``). + * SMTChecker: Fix internal error in the CHC engine when passing gas in the function options. + * TypeChecker: Fix internal error when using arrays and structs with user defined value types before declaration. + * TypeChecker: Fix internal error when using user defined value types in public library functions. + * TypeChecker: Improved error message for constant variables with (nested) mapping types. + * Yul Assembler: Fix internal error when function names are not unique. + * Yul IR Generator: Do not output empty switches/if-bodies for empty contracts. + + +Important Bugfixes in Experimental Features: + * Yul IR Generator: Changes to function return variables referenced in modifier invocation arguments were not properly forwarded if there was more than one return variable. + + +Build System: + * Pass linker-only emscripten options only when linking. + * Remove obsolete compatibility workaround for emscripten builds. + * Update emscripten to version 2.0.33. + + +### 0.8.9 (2021-09-29) + +Important Bugfixes: + * Immutables: Properly perform sign extension on signed immutables. + * User Defined Value Type: Fix storage layout of user defined value types for underlying types shorter than 32 bytes. + + +Bugfixes: + * AST: Export ``canonicalName`` for ``UserDefinedValueTypeDefinition`` and ``ContractDefinition``. + + + +### 0.8.8 (2021-09-27) + +Language Features: + * Inheritance: A function that overrides only a single interface function does not require the ``override`` specifier. + * Type System: Support ``type(E).min`` and ``type(E).max`` for enums. + * User Defined Value Type: allows creating a zero cost abstraction over a value type with stricter type requirements. + + +Compiler Features: + * Commandline Interface: Add ``--include-path`` option for specifying extra directories that may contain importable code (e.g. packaged third-party libraries). + * Commandline Interface: Do not implicitly run evm bytecode generation unless needed for the requested output. + * Commandline Interface: Normalize paths specified on the command line and make them relative for files located inside base path and/or include paths. + * Immutable variables can be read at construction time once they are initialized. + * SMTChecker: Add constraints to better correlate ``address(this).balance`` and ``msg.value``. + * SMTChecker: Support constants via modules. + * SMTChecker: Support low level ``call`` as external calls to unknown code. + * SMTChecker: Support the ``value`` option for external function calls. + * SMTChecker: Support user defined value types. + + +Bugfixes: + * Code Generator: Fix ICE on assigning to calldata structs and statically-sized calldata arrays in inline assembly. + * Code Generator: Use stable source order for ABI functions. + * Commandline Interface: Disallow the ``--experimental-via-ir`` option in Standard JSON, Assembler and Linker modes. + * Commandline Interface: Fix resolution of paths whitelisted with ``--allowed-paths`` or implicitly due to base path, remappings and files being compiled. Correctly handle paths that do not match imports exactly due to being relative, non-normalized or empty. + * Commandline Interface: Report optimizer options as invalid in Standard JSON and linker modes instead of ignoring them. + * Name Resolver: Fix that when importing an aliased symbol using ``import {AliasedName} from "a.sol"`` it would use the original name of the symbol and not the aliased one. + * Opcode Optimizer: Prevent the optimizer from running multiple times to avoid potential bytecode differences for referenced code. + * Parser: Properly check for multiple SPDX license identifiers next to each other and validate them. + * SMTChecker: Fix BMC's constraints regarding internal functions. + * SMTChecker: Fix false negative caused by ``push`` on storage array references returned by internal functions. + * SMTChecker: Fix false positive in external calls from constructors. + * SMTChecker: Fix internal error on some multi-source uses of ``abi.*``, cryptographic functions and constants. + * Standard JSON: Fix non-fatal errors in Yul mode being discarded if followed by a fatal error. + * Type Checker: Correct wrong error message in inline assembly complaining about ``.slot`` or ``.offset`` not valid when actually ``.length`` was used. + * Type Checker: Disallow modifier declarations and definitions in interfaces. + * Yul Optimizer: Fix a crash in LoadResolver, when ``keccak256`` has particular non-identifier arguments. + + + +### 0.8.7 (2021-08-11) + +Language Features: + * Introduce global ``block.basefee`` for retrieving the base fee of the current block. + * Yul: Introduce builtin ``basefee()`` for retrieving the base fee of the current block. + + +Compiler Features: + * AssemblyStack: Also run opcode-based optimizer when compiling Yul code. + * Commandline Interface: option ``--pretty-json`` works also with ``--standard--json``. + * EVM: Set the default EVM version to "London". + * SMTChecker: Do not check underflow and overflow by default. + * SMTChecker: Unproved targets are hidden by default, and the SMTChecker only states how many unproved targets there are. They can be listed using the command line option ``--model-checker-show-unproved`` or the JSON option ``settings.modelChecker.showUnproved``. + * SMTChecker: new setting to enable/disable encoding of division and modulo with slack variables. The command line option is ``--model-checker-div-mod-slacks`` and the JSON option is ``settings.modelChecker.divModWithSlacks``. + * Yul EVM Code Transform: Also pop unused argument slots for functions without return variables (under the same restrictions as for functions with return variables). + * Yul EVM Code Transform: Do not reuse stack slots that immediately become unreachable. + * Yul Optimizer: Move function arguments and return variables to memory with the experimental Stack Limit Evader (which is not enabled by default). + + +Bugfixes: + * Code Generator: Fix crash when passing an empty string literal to ``bytes.concat()``. + * Code Generator: Fix internal compiler error when calling functions bound to calldata structs and arrays. + * Code Generator: Fix internal compiler error when passing a 32-byte hex literal or a zero literal to ``bytes.concat()`` by disallowing such literals. + * Commandline Interface: Apply ``--optimizer-runs`` option in assembly / yul mode. + * Commandline Interface: Fix crash when a directory path is passed to ``--standard-json``. + * Commandline Interface: Read JSON from standard input when ``--standard-json`` gets ``-`` as a file name. + * Standard JSON: Include source location for errors in files with empty name. + * Type Checker: Fix internal error and prevent static calls to unimplemented modifiers. + * Yul Code Generator: Fix internal compiler error when using a long literal with bitwise negation. + * Yul Code Generator: Fix source location references for calls to builtin functions. + * Yul Parser: Fix source location references for ``if`` statements. + + +### 0.8.6 (2021-06-22) + +Language Features: + * Yul: Special meaning of ``".metadata"`` data object in Yul object. + + +Bugfixes: + * Control Flow Graph: Fix incorrectly reported unreachable code. + * Solc-Js: When running ``solcjs`` without the ``--optimize`` flag, use ``settings.optimizer.enabled=false`` in Standard JSON instead of omitting the key. + * Standard JSON: Omitting ``settings.optimizer.enabled`` was not equivalent to setting it to ``false``. It meant disabling also the peephole optimizer and jumpdest remover which by default still run with ``enabled=false``. + + +### 0.8.5 (2021-06-10) + +Language Features: + * Allowing conversion from ``bytes`` and ``bytes`` slices to ``bytes1``/.../``bytes32``. + * Yul: Add ``verbatim`` builtin function to inject arbitrary bytecode. + + +Compiler Features: + * Code Generator: Insert helper functions for panic codes instead of inlining unconditionally. This can reduce costs if many panics (checks) are inserted, but can increase costs where few panics are used. + * EVM: Set the default EVM version to "Berlin". + * SMTChecker: Function definitions can be annotated with the custom Natspec tag ``custom:smtchecker abstract-function-nondet`` to be abstracted by a nondeterministic value when called. + * Standard JSON / combined JSON: New artifact "functionDebugData" that contains bytecode offsets of entry points of functions and potentially more information in the future. + * Yul Optimizer: Evaluate ``keccak256(a, c)``, when the value at memory location ``a`` is known at compile time and ``c`` is a constant ``<= 32``. + + +Bugfixes: + * AST: Do not output value of Yul literal if it is not a valid UTF-8 string. + * Code Generator: Fix internal error when function arrays are assigned to storage variables and the function types can be implicitly converted but are not identical. + * Code Generator: Fix internal error when super would have to skip an unimplemented function in the virtual resolution order. + * Control Flow Graph: Assume unimplemented modifiers use a placeholder. + * Control Flow Graph: Take internal calls to functions that always revert into account for reporting unused or unassigned variables. + * Function Call Graph: Fix internal error connected with circular constant references. + * Name Resolver: Do not issue shadowing warning if the shadowing name is not directly accessible. + * Natspec: Allow multiple ``@return`` tags on public state variable documentation. + * SMTChecker: Fix internal error on conversion from ``bytes`` to ``fixed bytes``. + * SMTChecker: Fix internal error on external calls from the constructor. + * SMTChecker: Fix internal error on struct constructor with fixed bytes member initialized with string literal. + * Source Locations: Properly set source location of scoped blocks. + * Standard JSON: Properly allow the ``inliner`` setting under ``settings.optimizer.details``. + * Type Checker: Fix internal compiler error related to having mapping types in constructor parameter for abstract contracts. + * Type Checker: Fix internal compiler error when attempting to use an invalid external function type on pre-byzantium EVMs. + * Type Checker: Fix internal compiler error when overriding receive ether function with one having different parameters during inheritance. + * Type Checker: Make errors about (nested) mapping type in event or error parameter into fatal type errors. + * Type Checker: Fix internal compiler error when overriding an implemented modifier with an unimplemented one. + + +AST Changes: + * Add member `hexValue` for Yul string and hex literals. + + + +### 0.8.4 (2021-04-21) + +Important Bugfixes: + * ABI Decoder V2: For two-dimensional arrays and specially crafted data in memory, the result of ``abi.decode`` can depend on data elsewhere in memory. Calldata decoding is not affected. + + +Language Features: + * Assembly / Yul: Allow hex string literals. + * Possibility to use ``bytes.concat`` with variable number of ``bytes`` and ``bytesNN`` arguments which behaves as a restricted version of `abi.encodePacked` with a more descriptive name. + * Support custom errors via the ``error`` keyword and introduce the ``revert`` statement. + + +Compiler Features: + * Analysis: Properly detect circular references to the bytecode of other contracts across all function calls. + * Commandline Interface: Model checker option ``--model-checker-targets`` also accepts ``outOfBounds``. + * Commandline Interface: New model checker option ``--model-checker-contracts`` allows users to select which contracts should be analyzed as the most derived. + * Low-Level Inliner: Inline ordinary jumps to small blocks and jumps to small blocks that terminate. + * NatSpec: Allow ``@notice`` tag on non-public state variables and local variable declarations. The documentation will only be part of the AST, under the field ``documentation``. + * SMTChecker: Deprecate ``pragma experimental SMTChecker;`` and set default model checker engine to ``none``. + * SMTChecker: Report local variables in CHC counterexamples. + * SMTChecker: Report out of bounds index access for arrays and fixed bytes. + * SMTChecker: Support file level functions and constants. + * Standard JSON: Model checker option ``settings.modelChecker.targets`` also accepts ``outOfBounds``. + * Standard JSON: Model checker option ``settings.modelChecker.targets`` takes an array of string targets instead of string of comma separated targets. + * Standard JSON: New model checker option ``settings.modelChecker.contracts`` allows users to select which contracts should be analyzed as the most derived. + * Yul EVM Code Transform: Stack Optimization: Reuse slots of unused function arguments and defer allocating stack slots for return variables until after expression statements and assignments that do not reference them. + * Yul Optimizer: Added a new step FunctionSpecializer, that specializes a function with its literal arguments. + + +Bugfixes: + * Antlr Grammar: Fix parsing of import paths involving properly distinguishing between empty and non-empty string literals in general. + * AST Output: Fix ``kind`` field of ``ModifierInvocation`` for base constructor calls. + * Commandline interface: Fix internal error when printing AST and using ``--base-path`` or ``file://`` prefix in imports. + * Commandline interface: Fix standard input bypassing allowed path checks. + * Natspec: Fix internal error related to the `@returns` documentation for a public state variable overriding a function. + * SMTChecker: Fix false positive and false negative on ``push`` as LHS of a compound assignment. + * SMTChecker: Fix false positive in contracts that cannot be deployed. + * SMTChecker: Fix internal error on public getter returning dynamic data on older EVM versions where these are not available. + * SMTChecker: Fix internal error on try-catch with function call in catch block. + * Type Checker: Fix missing error when events are used without an emit statement. + + +AST Changes: + * New property for ``ContractDefinition`` nodes: ``usedErrors`` lists AST IDs of all errors used by the contract (even if defined outside). + + + +### 0.8.3 (2021-03-23) + +Important Bugfixes: + * Optimizer: Fix bug on incorrect caching of Keccak-256 hashes. + +Compiler Features: + * Command Line Interface: Drop experimental support for ``--machine evm15``. + * Optimizer: Try to move ``and`` with constant inside ``or`` to improve storage writes of small types. + * Optimizer: Replace multiplications and divisions with powers of two by shifts. + +Bugfixes: + * AST Import: For constructors, a public visibility is ignored during importing. + * Error Reporter: Fix handling of carriage return. + * SMTChecker: Fix internal error in BMC on resolving virtual functions inside branches. + * SMTChecker: Fix internal error on ``array.pop`` nested inside 1-tuple. + * SMTChecker: Fix internal error on ``FixedBytes`` constant initialized with string literal. + * SMTChecker: Fix internal error on array slices. + * SMTChecker: Fix internal error on calling public getter on a state variable of type array (possibly nested) of structs. + * SMTChecker: Fix internal error on pushing to ``string`` casted to ``bytes``. + * SMTChecker: Fix bug in virtual functions called by constructors. + +AST Changes: + * ModifierInvocation: Add ``kind`` field which can be ``modifierInvocation`` or ``baseConstructorSpecifier``. + + +### 0.8.2 (2021-03-02) + +Compiler Features: + * AST: Export NatSpec comments above each statement as their documentation. + * Inline Assembly: Do not warn anymore about variables or functions being shadowed by EVM opcodes. + * NatSpec: Provide source locations for parsing errors. + * Optimizer: Simple inlining when jumping to small blocks that jump again after a few side-effect free opcodes. + * NatSpec: Allow and export all tags that start with ``@custom:``. + + +Bugfixes: + * AST: Added ``referencedDeclaration`` for enum members. + * Code Generator: Fix internal error when functions are passed as parameters of other callables, when the function types can be implicitly converted, but not identical. + * Parser: Properly parse ``.address`` in some situations. + * SMTChecker: Fix missing type constraints on block and transaction variables in the deployment phase. + * Type Checker: Fix internal error when override specifier is not a contract. + * Type Checker: Make function-hash collision errors into fatal type errors. + + +AST Changes: + * Adds ``nameLocation`` to declarations to represent the exact location of the symbolic name. + * Removed the redundant function type "bytearraypush" - replaced by "arraypush". + * Support field ``documentation`` to hold NatSpec comments above each statement. + + +### 0.8.1 (2021-01-27) + +Language Features: + * Possibility to use ``catch Panic(uint code)`` to catch a panic failure from an external call. + +Compiler Features: + * Code Generator: Reduce the cost of ``
.code.length`` by using ``extcodesize`` directly. + * Command Line Interface: Allow ``=`` as separator between library name and address in ``--libraries`` commandline option. + * Command Line Interface: New option ``--model-checker-targets`` allows specifying which targets should be checked. The valid options are ``all``, ``constantCondition``, ``underflow``, ``overflow``, ``divByZero``, ``balance``, ``assert``, ``popEmptyArray``, where the default is ``all``. Multiple targets can be chosen at the same time, separated by a comma without spaces: ``underflow,overflow,assert``. + * Command Line Interface: Only accept library addresses with a prefix of ``0x`` in ``--libraries`` commandline option. + * Optimizer: Add rule to replace ``iszero(sub(x,y))`` by ``eq(x,y)``. + * Parser: Report meaningful error if parsing a version pragma failed. + * SMTChecker: Output internal and trusted external function calls in a counterexample's transaction trace. + * SMTChecker: Show ``msg.value`` in counterexample transaction traces when greater than 0. + * SMTChecker: Show contract name in counterexample function call. + * SMTChecker: Support ABI functions as uninterpreted functions. + * SMTChecker: Support try/catch statements. + * SMTChecker: Synthesize untrusted functions called externally. + * SMTChecker: Use checked arithmetic by default and support ``unchecked`` blocks. + * Standard JSON: New option ``modelCheckerSettings.targets`` allows specifying which targets should be checked. The valid options are ``all``, ``constantCondition``, ``underflow``, ``overflow``, ``divByZero``, ``balance``, ``assert``, ``popEmptyArray``, where the default is ``all``. Multiple targets can be chosen at the same time, separated by a comma without spaces: ``underflow,overflow,assert``. + +Bugfixes: + * Code Generator: Fix length check when decoding malformed error data in catch clause. + * Control Flow Graph: Fix missing error caused by read from/write to uninitialized variables. + * SMTChecker: Fix false negatives in overriding modifiers and functions. + * SMTChecker: Fix false negatives in the presence of inline assembly. + * SMTChecker: Fix false negatives when analyzing external function calls. + * SMTChecker: Fix internal error on ``block.chainid``. + * SMTChecker: Fix internal error on pushing string literal to ``bytes`` array. + * SMTChecker: Fix missing type constraints for block variables. + * Type Checker: Fix infinite loop when accessing circular constants from inline assembly. + * Type Checker: Fix internal error caused by constant structs containing mappings. + * Type System: Disallow implicit conversion from ``uintN`` to ``intM`` when ``M > N``, and by extension, explicit conversion between the same types is also disallowed. + +Build System: + * Update the soljson.js build to emscripten 2.0.12 and boost 1.75.0. + + +### 0.8.0 (2020-12-16) + +Breaking Changes: + * Code Generator: All arithmetic is checked by default. These checks can be disabled using ``unchecked { ... }``. + * Code Generator: Cause a panic if a byte array in storage is accessed whose length is encoded incorrectly. + * Code Generator: Use ``revert`` with error signature ``Panic(uint256)`` and error codes instead of invalid opcode on failing assertions. + * Command Line Interface: JSON fields `abi`, `devdoc`, `userdoc` and `storage-layout` are now sub-objects rather than strings. + * Command Line Interface: Remove the ``--old-reporter`` option. + * Command Line Interface: Remove the legacy ``--ast-json`` option. Only the ``--ast-compact-json`` option is supported now. + * General: Enable ABI coder v2 by default. + * General: Remove global functions ``log0``, ``log1``, ``log2``, ``log3`` and ``log4``. + * Parser: Exponentiation is right associative. ``a**b**c`` is parsed as ``a**(b**c)``. + * Scanner: Remove support for the ``\b``, ``\f``, and ``\v`` escape sequences. + * Standard JSON: Remove the ``legacyAST`` option. + * Type Checker: Function call options can only be given once. + * Type System: Declarations with the name ``this``, ``super`` and ``_`` are disallowed, with the exception of public functions and events. + * Type System: Disallow ``msg.data`` in ``receive()`` function. + * Type System: Disallow ``type(super)``. + * Type System: Disallow enums with more than 256 members. + * Type System: Disallow explicit conversions from negative literals and literals larger than ``type(uint160).max`` to ``address`` type. + * Type System: Disallow the ``byte`` type. It was an alias to ``bytes1``. + * Type System: Explicit conversion to ``address`` type always returns a non-payable ``address`` type. In particular, ``address(u)``, ``address(b)``, ``address(c)`` and ``address(this)`` have the type ``address`` instead of ``address payable`` (Here ``u``, ``b``, and ``c`` are arbitrary variables of type ``uint160``, ``bytes20`` and contract type respectively.) + * Type System: Explicit conversions between two types are disallowed if it changes more than one of sign, width or kind at the same time. + * Type System: Explicit conversions from literals to enums are only allowed if the value fits in the enum. + * Type System: Explicit conversions from literals to integer type is as strict as implicit conversions. + * Type System: Introduce ``address(...).code`` to retrieve the code as ``bytes memory``. The size can be obtained via ``address(...).code.length``, but it will currently always include copying the code. + * Type System: Introduce ``block.chainid`` for retrieving the current chain id. + * Type System: Support ``address(...).codehash`` to retrieve the codehash of an account. + * Type System: The global variables ``tx.origin`` and ``msg.sender`` have type ``address`` instead of ``address payable``. + * Type System: Unary negation can only be used on signed integers, not on unsigned integers. + * View Pure Checker: Mark ``chainid`` as view. + * Yul: Disallow the use of reserved identifiers, such as EVM instructions, even if they are not available in the given dialect / EVM version. + * Yul: The ``assignimmutable`` builtin in the "EVM with objects" dialect takes the base offset of the code to modify as an additional argument. + +Language Features: + * Super constructors can now be called using the member notation e.g. ``M.C(123)``. + +Bugfixes: + * Type Checker: Perform proper truncating integer arithmetic when using constants in array length expressions. + +AST Changes: + * New AST Node ``IdentifierPath`` replacing in many places the ``UserDefinedTypeName``. + * New AST Node ``UncheckedBlock`` used for ``unchecked { ... }``. + +### 0.7.6 (2020-12-16) + +Language Features: + * Code generator: Support conversion from calldata slices to memory and storage arrays. + * Code generator: Support copying dynamically encoded structs from calldata to memory. + * Code generator: Support copying of nested arrays from calldata to memory. + * Scanner: Generate a parser error when comments or unicode strings contain an unbalanced or underflowing set of unicode direction override markers (LRO, RLO, LRE, RLE, PDF). + * The fallback function can now also have a single ``calldata`` argument (equaling ``msg.data``) and return ``bytes memory`` (which will not be ABI-encoded but returned as-is). + * Wasm backend: Add ``i32.select`` and ``i64.select`` instructions. + +Compiler Features: + * Build System: Optionally support dynamic loading of Z3 and use that mechanism for Linux release builds. + * Code Generator: Avoid memory allocation for default value if it is not used. + * SMTChecker: Apply constant evaluation on binary arithmetic expressions. + * SMTChecker: Create underflow and overflow verification targets for increment/decrement in the CHC engine. + * SMTChecker: Report struct values in counterexamples from CHC engine. + * SMTChecker: Support early returns in the CHC engine. + * SMTChecker: Support getters. + * SMTChecker: Support named arguments in function calls. + * SMTChecker: Support struct constructor. + * Standard-Json: Move the recently introduced ``modelCheckerSettings`` key to ``settings.modelChecker``. + * Standard-Json: Properly filter the requested output artifacts. + +Bugfixes: + * Code generator: Do not pad empty string literals with a single 32-byte zero field in the ABI coder v1. + * NatSpec: Fix segfault when inheriting return parameter documentation for modifiers with no parameters. + * SMTChecker: Fix cast string literals to byte arrays. + * SMTChecker: Fix internal compiler error when doing bitwise compound assignment with string literals. + * SMTChecker: Fix internal error when trying to generate counterexamples with old z3. + * SMTChecker: Fix segmentation fault that could occur on certain SMT-enabled sources when no SMT solver was available. + * SMTChecker: Fix internal error when ``bytes.push()`` is used as the LHS of an assignment. + * Type Checker: ``super`` is not available in libraries. + * Type Checker: Disallow leading zeroes in sized-types (e.g. ``bytes000032``), but allow them to be treated as identifiers. + * Yul Optimizer: Fix a bug in NameSimplifier where a new name created by NameSimplifier could also be created by NameDispenser. + * Yul Optimizer: Removed NameSimplifier from optimization steps available to users. + +### 0.7.5 (2020-11-18) + +Language Features: + * Ability to select the abi coder using ``pragma abicoder v1`` and ``pragma abicoder v2``. + * Inline Assembly: Use ``.offset`` and ``.length`` for calldata variables of dynamic array type to access their calldata offset and length (number of elements). Both of them can also be assigned to. + * Immutable variables with literal number values are considered pure. + +Compiler Features: + * Assembler: Perform linking in assembly mode when library addresses are provided. + * Command Line Interface: New option ``--experimental-via-ir`` allows switching compilation process to go through the Yul intermediate representation. This is highly experimental and is used for development purposes. + * Command Line Interface: New option ``--model-checker-timeout`` sets a timeout in milliseconds for each individual query performed by the SMTChecker. + * Command Line Interface: Report error if file could not be read in ``--standard-json`` mode. + * Command Line interface: Report proper error for each output file which could not be written. Previously an exception was thrown, and execution aborted, on the first error. + * SMTChecker: Add division by zero checks in the CHC engine. + * SMTChecker: More precise analysis of external calls using ``this``. + * SMTChecker: Support ``selector`` for expressions with value known at compile-time. + * Standard JSON: New option ``modelCheckerSettings.timeout`` sets a timeout in milliseconds for each individual query performed by the SMTChecker. + * Standard JSON: New option ``settings.viaIR`` allows the same switch as ``--experimental-via-ir`` on the commandline. + + +Bugfixes: + * Code generator: Fix missing creation dependency tracking for abstract contracts. + * Command Line Interface: Fix write error when the directory passed to ``--output-dir`` ends with a slash. + * Command Line Interface: Reject duplicate libraries in ``--libraries`` option instead of arbitrarily choosing one. + * NatSpec: Fix internal error when inheriting return parameter documentation but the parameter names differ between base and inherited. + * SMTChecker: Fix CHC false positives when branches are used inside modifiers. + * SMTChecker: Fix false negative in modifier applied multiple times. + * SMTChecker: Fix incorrect counterexamples reported by the CHC engine. + * SMTChecker: Fix internal error in the BMC engine when inherited contract from a different source unit has private state variables. + * SMTChecker: Fix internal error on conversion from string literal to byte. + * SMTChecker: Fix internal error when ``array.push()`` is used as the LHS of an assignment. + * SMTChecker: Fix internal error when assigning state variable via contract's name. + * SMTChecker: Fix internal error when using tuples of rational literals inside the conditional operator. + * SMTChecker: Fix lack of reporting potential violations when using only the CHC engine. + * Standard JSON: Fix library addresses specified in ``libraries`` being used for linking even if the file names do not match. + +AST Changes: + * New member ``suffix`` for inline assembly identifiers. Currently supported values are ``"slot"``, ``"offset"`` and ``"length"`` to access the components of a Solidity variable. + + +### 0.7.4 (2020-10-19) + +Important Bugfixes: + * Code Generator: Fix data corruption bug when copying empty byte arrays from memory or calldata to storage. + + +Language Features: + * Constants can be defined at file level. + + +Compiler Features: + * Command Line Interface: New option ``--model-checker-engine`` allows to choose a specific SMTChecker engine. Options are ``all`` (default), ``bmc``, ``chc`` and ``none``. + * Control Flow Graph: Print warning for non-empty functions with unnamed return parameters that are not assigned a value in all code paths. + * SMTChecker: Support ``keccak256``, ``sha256``, ``ripemd160`` and ``ecrecover`` in the CHC engine. + * SMTChecker: Support inline arrays. + * SMTChecker: Support variables ``block``, ``msg`` and ``tx`` in the CHC engine. + * Standard JSON: New option ``modelCheckerSettings.engine`` allows to choose a specific SMTChecker engine. Options are ``all`` (default), ``bmc``, ``chc`` and ``none``. + + +Bugfixes: + * Code generator: Fix ``ABIEncoderV2`` pragma from the current module affecting inherited functions and applied modifiers. + * Code generator: Fix internal compiler error when referencing members via module name but not using the reference. + * Code generator: Fix internal error on returning structs containing mappings from library function. + * Code generator: Use revert instead of invalid opcode for out-of-bounds array index access in getter. + * Contract Level Checker: Add missing check against inheriting functions with ABIEncoderV2 return types in ABIEncoderV1 contracts. + * Name Resolver: Fix shadowing/same-name warnings for later declarations. + * Type Checker: Allow arrays of contract types as type expressions and as arguments for ``abi.decode``. + * Type Checker: Disallow invalid use of library names as type name. + * Type Checker: Fix internal compiler error caused by storage parameters with nested mappings in libraries. + + +### 0.7.3 (2020-10-07) + +Important Bugfixes: + * Code Generator: Properly cleanup after copying dynamic-array to storage for packed types. + +Compiler Features: + * Code generator: Implemented events with function type as one of its indexed parameters. + * General: Option to stop compilation after parsing stage. Can be used with ``solc --stop-after parsing`` + * Optimizer: Optimize ``exp`` when base is ``-1``. + * SMTChecker: Support ``addmod`` and ``mulmod``. + * SMTChecker: Support array slices. + * SMTChecker: Support type conversions. + + +Bugfixes: + * Fixed internal compiler errors for certain contracts involving the ``new`` expression. + * JSON AST: Fix internal error when using ``--ast-json`` on a function with memory arguments in ABIEncoderV2 contracts. + * Type Checker: Add missing checks for calls using types incompatible with ABIEncoderV1 in modules where ABIEncoderV2 is not enabled. + * Type Checker: Fix internal compiler error when calling `.push()` for a storage array with a nested mapping. + + +### 0.7.2 (2020-09-28) + +Important Bugfixes: + * Type Checker: Disallow two or more free functions with identical name (potentially imported and aliased) and parameter types. + +Compiler Features: + * Export compiler-generated utility sources via standard-json or combined-json. + * Optimizer: Optimize ``exp`` when base is 0, 1 or 2. + * SMTChecker: Keep knowledge about string literals, even through assignment, and thus support the ``.length`` property properly. + * SMTChecker: Support ``address`` type conversion with literals, e.g. ``address(0)``. + * SMTChecker: Support ``revert()``. + * SMTChecker: Support ``type(T).min``, ``type(T).max``, and ``type(I).interfaceId``. + * SMTChecker: Support compound and, or, and xor operators. + * SMTChecker: Support events and low-level logs. + * SMTChecker: Support fixed bytes index access. + * SMTChecker: Support memory allocation, e.g. ``new bytes(123)``. + * SMTChecker: Support shifts. + * SMTChecker: Support structs. + * Type Checker: Explain why oversized hex string literals can not be explicitly converted to a shorter ``bytesNN`` type. + * Type Checker: More detailed error messages why implicit conversions fail. + * Type Checker: Report position of first invalid UTF-8 sequence in ``unicode""`` literals. + * Yul IR Generator: Report source locations related to unimplemented features. + * Yul Optimizer: Inline into functions further down in the call graph first. + * Yul Optimizer: Prune unused parameters in functions. + * Yul Optimizer: Try to simplify function names. + + +Bugfixes: + * Code generator: Fix internal error on stripping dynamic types from return parameters on EVM versions without ``RETURNDATACOPY``. + * Type Checker: Add missing check against nested dynamic arrays in ABI encoding functions when ABIEncoderV2 is disabled. + * Type Checker: Correct the error message for invalid named parameter in a call to refer to the right argument. + * Type Checker: Disallow ``virtual`` for modifiers in libraries. + * Name Resolver: Correct the warning for homonymous, but not shadowing declarations. + * Type system: Fix internal error on implicit conversion of contract instance to the type of its ``super``. + * Type system: Fix internal error on implicit conversion of string literal to a calldata string. + * Type system: Fix named parameters in overloaded function and event calls being matched incorrectly if the order differs from the declaration. + * ViewPureChecker: Prevent visibility check on constructors. + + +### 0.7.1 (2020-09-02) + +Language Features: + * Allow function definitions outside of contracts, behaving much like internal library functions. + * Code generator: Implementing copying structs from calldata to storage. + +Compiler Features: + * SMTChecker: Add underflow and overflow as verification conditions in the CHC engine. + * SMTChecker: Support bitwise or, xor and not operators. + * SMTChecker: Support conditional operator. + * Standard JSON Interface: Do not run EVM bytecode code generation, if only Yul IR or EWasm output is requested. + * Yul Optimizer: LoopInvariantCodeMotion can move reading operations outside for-loops as long as the affected area is not modified inside the loop. + * Yul: Report error when using non-string literals for ``datasize()``, ``dataoffset()``, ``linkersymbol()``, ``loadimmutable()``, ``setimmutable()``. + +Bugfixes: + * AST: Remove ``null`` member values also when the compiler is used in standard-json-mode. + * General: Allow `type(Contract).name` for abstract contracts and interfaces. + * Immutables: Disallow assigning immutables more than once during their declaration. + * Immutables: Properly treat complex assignment and increment/decrement as both reading and writing and thus disallow it everywhere for immutable variables. + * Optimizer: Keep side-effects of ``x`` in ``byte(a, shr(b, x))`` even if the constants ``a`` and ``b`` would make the expression zero unconditionally. This optimizer rule is very hard if not impossible to trigger in a way that it can result in invalid code, though. + * References Resolver: Fix internal bug when using constructor for library. + * Scanner: Fix bug where whitespace would be allowed within the ``->`` token (e.g. ``function f() - > x {}`` becomes invalid in inline assembly and Yul). + * SMTChecker: Fix internal error in BMC function inlining. + * SMTChecker: Fix internal error on array implicit conversion. + * SMTChecker: Fix internal error on fixed bytes index access. + * SMTChecker: Fix internal error on lvalue unary operators with tuples. + * SMTChecker: Fix internal error on tuple assignment. + * SMTChecker: Fix internal error on tuples of one element that have tuple type. + * SMTChecker: Fix internal error when using imported code. + * SMTChecker: Fix soundness of array ``pop``. + * Type Checker: Disallow ``using for`` directive inside interfaces. + * Type Checker: Disallow signed literals as exponent in exponentiation operator. + * Type Checker: Disallow structs containing nested mapping in memory as parameters for library functions. + * Yul Optimizer: Ensure that Yul keywords are not mistakenly used by the NameDispenser and VarNameCleaners. The bug would manifest as uncompilable code. + * Yul Optimizer: Make function inlining order more resilient to whether or not unrelated source files are present. + + +### 0.7.0 (2020-07-28) + +Breaking changes: + * Inline Assembly: Disallow ``.`` in user-defined function and variable names. + * Inline Assembly: Slot and offset of storage pointer variable ``x`` are accessed via ``x.slot`` and ``x.offset`` instead of ``x_slot`` and ``x_offset``. + * JSON AST: Mark hex string literals with ``kind: "hexString"``. + * JSON AST: Remove members with ``null`` value from JSON output. + * Parser: Disallow ``gwei`` as identifier. + * Parser: Disallow dot syntax for ``value`` and ``gas``. + * Parser: Disallow non-printable characters in string literals. + * Parser: Introduce Unicode string literals: ``unicode"😃"``. + * Parser: NatSpec comments on variables are only allowed for public state variables. + * Parser: Remove the ``finney`` and ``szabo`` denominations. + * Parser: Remove the identifier ``now`` (replaced by ``block.timestamp``). + * Reference Resolver: ``using A for B`` only affects the contract it is mentioned in and not all derived contracts + * Type Checker: Disallow ``virtual`` for library functions. + * Type Checker: Disallow assignments to state variables that contain nested mappings. + * Type checker: Disallow events with same name and parameter types in inheritance hierarchy. + * Type Checker: Disallow shifts by signed types. + * Type Checker: Disallow structs and arrays in memory or calldata if they contain nested mappings. + * Type Checker: Exponentiation and shifts of literals by non-literals will always use ``uint256`` or ``int256`` as a type. + * Yul: Disallow consecutive and trailing dots in identifiers. Leading dots were already disallowed. + * Yul: Disallow EVM instruction `pc()`. + + +Language Features: + * Inheritance: Allow overrides to have stricter state mutability: ``view`` can override ``nonpayable`` and ``pure`` can override ``view``. + * Parser: Deprecate visibility for constructors. + * State mutability: Do not issue recommendation for stricter mutability for virtual functions but do issue it for functions that override. + + +Compiler Features: + * SMTChecker: Report multi-transaction counterexamples including the function calls that initiate the transactions. This does not include concrete values for reference types and reentrant calls. + * Variable declarations using the ``var`` keyword are not recognized anymore. + + +Bugfixes: + * Immutables: Fix internal compiler error when immutables are not assigned. + * Inheritance: Disallow public state variables overwriting ``pure`` functions. + * NatSpec: Constructors and functions have consistent userdoc output. + * SMTChecker: Fix internal error when assigning to a 1-tuple. + * SMTChecker: Fix internal error when tuples have extra effectless parenthesis. + * State Mutability: Constant public state variables are considered ``pure`` functions. + * Type Checker: Fixing deduction issues on function types when function call has named arguments. + + +### 0.6.12 (2020-07-22) + +Language Features: + * NatSpec: Implement tag ``@inheritdoc`` to copy documentation from a specific base contract. + * Wasm backend: Add ``i32.ctz``, ``i64.ctz``, ``i32.popcnt``, and ``i64.popcnt``. + + +Compiler Features: + * Code Generator: Avoid double cleanup when copying to memory. + * Code Generator: Evaluate ``keccak256`` of string literals at compile-time. + * Optimizer: Add rule to remove shifts inside the byte opcode. + * Peephole Optimizer: Add rule to remove swap after dup. + * Peephole Optimizer: Remove unnecessary masking of tags. + * Yul EVM Code Transform: Free stack slots directly after visiting the right-hand-side of variable declarations instead of at the end of the statement only. + + +Bugfixes: + * SMTChecker: Fix error in events with indices of type static array. + * SMTChecker: Fix internal error in sequential storage array pushes (``push().push()``). + * SMTChecker: Fix internal error when using bitwise operators on fixed bytes type. + * SMTChecker: Fix internal error when using compound bitwise operator assignments on array indices inside branches. + * Type Checker: Fix internal compiler error related to oversized types. + * Type Checker: Fix overload resolution in combination with ``{value: ...}``. + + +Build System: + * Update internal dependency of jsoncpp to 1.9.3. + + +### 0.6.11 (2020-07-07) + + +Language Features: + * General: Add unit denomination ``gwei`` + * Yul: Support ``linkersymbol`` builtin in standalone assembly mode to refer to library addresses. + * Yul: Support using string literals exceeding 32 bytes as literal arguments for builtins. + + +Compiler Features: + * NatSpec: Add fields ``kind`` and ``version`` to the JSON output. + * NatSpec: Inherit tags from unique base functions if derived function does not provide any. + * Commandline Interface: Prevent some incompatible commandline options from being used together. + * NatSpec: Support NatSpec comments on events. + * Yul Optimizer: Store knowledge about storage / memory after ``a := sload(x)`` / ``a := mload(x)``. + * SMTChecker: Support external calls to unknown code. + * Source Maps: Also tag jumps into and out of Yul functions as jumps into and out of functions. + + +Bugfixes: + * NatSpec: Do not consider ``////`` and ``/***`` as NatSpec comments. + * Type Checker: Disallow constructor parameters with ``calldata`` data location. + * Type Checker: Do not disallow assigning to calldata variables. + * Type Checker: Fix internal error related to ``using for`` applied to non-libraries. + * Wasm backend: Fix code generation for for-loops with pre statements. + * Wasm backend: Properly support both ``i32.drop`` and ``i64.drop``, and remove ``drop``. + * Yul: Disallow the same variable to occur multiple times on the left-hand side of an assignment. + * Yul: Fix source location of variable multi-assignment. + + +### 0.6.10 (2020-06-11) + +Important Bugfixes: + * Fixed a bug related to internal library functions with ``calldata`` parameters called via ``using for``. + + +Compiler Features: + * Commandline Interface: Re-group help screen. + * Output compilation error codes in standard-json and when using ``--error-codes``. + * Yul: Raise warning for switch statements that only have a default and no other cases. + + +Bugfixes: + * SMTChecker: Fix internal error when encoding tuples of tuples. + * SMTChecker: Fix aliasing soundness after pushing to an array pointer. + * Type system: Fix internal compiler error on calling externally a function that returns variables with calldata location. + * Type system: Fix bug where a bound function was not found if ``using for`` is applied to explicit reference types. + + +### 0.6.9 (2020-06-04) + +Language Features: + * Permit calldata location for all variables. + * NatSpec: Support NatSpec comments on state variables. + * Yul: EVM instruction `pc()` is marked deprecated and will be removed in the next breaking release. + + +Compiler Features: + * Build system: Update the soljson.js build to emscripten 1.39.15 and boost 1.73.0 and include Z3 for integrated SMTChecker support without the callback mechanism. + * Build system: Switch the emscripten build from the fastcomp backend to the upstream backend. + * Code Generator: Do not introduce new internal source references for small compiler routines. + * Commandline Interface: Adds new option ``--base-path PATH`` to use the given path as the root of the source tree (defaults to the root of the filesystem). + * SMTChecker: Support array ``length``. + * SMTChecker: Support array ``push`` and ``pop``. + * SMTChecker: General support to BitVectors and the bitwise ``and`` operator. + + +Bugfixes: + * Code Generator: Trigger proper unimplemented errors on certain array copy operations. + * Commandline Interface: Fix internal error when using ``--assemble`` or ``--yul`` options with ``--machine ewasm`` but without specifying ``--yul-dialect``. + * NatSpec: DocString block is terminated when encountering an empty line. + * Optimizer: Fixed a bug in BlockDeDuplicator. + * Scanner: Fix bug when two empty NatSpec comments lead to scanning past EOL. + * SMTChecker: Fix internal error on try/catch clauses with parameters. + * SMTChecker: Fix internal error when applying arithmetic operators to fixed point variables. + * SMTChecker: Fix internal error when assigning to index access inside branches. + * SMTChecker: Fix internal error when short circuiting Boolean expressions with function calls in state variable initialization. + * Type Checker: Disallow assignments to storage variables of type ``mapping``. + * Type Checker: Disallow inline arrays of non-nameable types. + * Type Checker: Disallow usage of override with non-public state variables. + * Type Checker: Fix internal compiler error when accessing members of array slices. + * Type Checker: Fix internal compiler error when forward referencing non-literal constants from inline assembly. + * Type Checker: Fix internal compiler error when trying to decode too large static arrays. + * Type Checker: Fix wrong compiler error when referencing an overridden function without calling it. + + +### 0.6.8 (2020-05-14) + +Important Bugfixes: + * Add missing callvalue check to the creation code of a contract that does not define a constructor but has a base that does define a constructor. + * Disallow array slices of arrays with dynamically encoded base types. + * String literals containing backslash characters can no longer cause incorrect code to be generated when passed directly to function calls or encoding functions when ABIEncoderV2 is active. + + +Language Features: + * Implemented ``type(T).min`` and ``type(T).max`` for every integer type ``T`` that returns the smallest and largest value representable by the type. + + +Compiler Features: + * Commandline Interface: Don't ignore `--yul-optimizations` in assembly mode. + * Allow using abi encoding functions for calldata array slices without explicit casts. + * Wasm binary output: Implement ``br`` and ``br_if``. + + +Bugfixes: + * ABI: Skip ``private`` or ``internal`` constructors. + * Fixed an "Assembly Exception in Bytecode" error where requested functions were generated twice. + * Natspec: Fixed a bug that ignored ``@return`` tag when no other developer-documentation tags were present. + * Type Checker: Checks if a literal exponent in the ``**`` operation is too large or fractional. + * Type Checker: Disallow accessing ``runtimeCode`` for contract types that contain immutable state variables. + * Yul Assembler: Fix source location of variable declarations without value. + + +### 0.6.7 (2020-05-04) + +Language Features: + * Add support for EIP 165 interface identifiers with `type(I).interfaceId`. + * Allow virtual modifiers inside abstract contracts to have empty body. + + +Compiler Features: + * Optimizer: Simplify repeated AND and OR operations. + * Standard Json Input: Support the prefix ``file://`` in the field ``urls``. + * Add option to specify optimization steps to be performed by Yul optimizer with `--yul-optimizations` in the commandline interface or `optimizer.details.yulDetails.optimizerSteps` in standard-json. + +Bugfixes: + * SMTChecker: Fix internal error when fixed points are used. + * SMTChecker: Fix internal error when using array slices. + * Type Checker: Disallow ``virtual`` and ``override`` for constructors. + * Type Checker: Fix several internal errors by performing size and recursiveness checks of types before the full type checking. + * Type Checker: Fix internal error when assigning to empty tuples. + * Type Checker: Fix internal error when applying unary operators to tuples with empty components. + * Type Checker: Perform recursiveness check on structs declared at the file level. + +Build System: + * soltest.sh: ``SOLIDITY_BUILD_DIR`` is no longer relative to ``REPO_ROOT`` to allow for build directories outside of the source tree. + + + +### 0.6.6 (2020-04-09) + +Important Bugfixes: + * Fix tuple assignments with components occupying multiple stack slots and different stack size on left- and right-hand-side. + + +Bugfixes: + * AST export: Export `immutable` property in the field `mutability`. + * SMTChecker: Fix internal error in the CHC engine when calling inherited functions internally. + * Type Checker: Error when trying to encode functions with call options gas and value set. + + + +### 0.6.5 (2020-04-06) + +Important Bugfixes: + * Code Generator: Restrict the length of dynamic memory arrays to 64 bits during creation at runtime fixing a possible overflow. + + +Language Features: + * Allow local storage variables to be declared without initialization, as long as they are assigned before they are accessed. + * State variables can be marked ``immutable`` which causes them to be read-only, but assignable in the constructor. The value will be stored directly in the code. + + +Compiler Features: + * Commandline Interface: Enable output of storage layout with `--storage-layout`. + * Metadata: Added support for IPFS hashes of large files that need to be split in multiple chunks. + + +Bugfixes: + * Inheritance: Allow public state variables to override functions with dynamic memory types in their return values. + * Inline Assembly: Fix internal error when accessing invalid constant variables. + * Inline Assembly: Fix internal error when accessing functions. + * JSON AST: Always add pointer suffix for memory reference types. + * Reference Resolver: Fix internal error when accessing invalid struct members. + * Type Checker: Fix internal errors when assigning nested tuples. + + +### 0.6.4 (2020-03-10) + +Language Features: + * General: Deprecated `value(...)` and `gas(...)` in favor of `{value: ...}` and `{gas: ...}` + * Inline Assembly: Allow assigning to `_slot` of local storage variable pointers. + * Inline Assembly: Perform control flow analysis on inline assembly. Allows storage returns to be set in assembly only. + + +Compiler Features: + * AssemblyStack: Support for source locations (source mappings) and thus debugging Yul sources. + * Commandline Interface: Enable output of experimental optimized IR via ``--ir-optimized``. + + +Bugfixes: + * Inheritance: Fix incorrect error on calling unimplemented base functions. + * Reference Resolver: Fix scoping issue following try/catch statements. + * Standard-JSON-Interface: Fix a bug related to empty filenames and imports. + * SMTChecker: Fix internal errors when analysing tuples. + * Yul AST Import: correctly import blocks as statements, switch statements and string literals. + +### 0.6.3 (2020-02-18) Language Features: * Allow contract types and enums as keys for mappings. + * Allow function selectors to be used as compile-time constants. + * Report source locations for structured documentation errors. Compiler Features: - * Code Generator: Use ``calldatacopy`` instead of ``codecopy`` to zero out memory past input. * AST: Add a new node for doxygen-style, structured documentation that can be received by contract, function, event and modifier definitions. + * Code Generator: Use ``calldatacopy`` instead of ``codecopy`` to zero out memory past input. * Debug: Provide reason strings for compiler-generated internal reverts when using the ``--revert-strings`` option or the ``settings.debug.revertStrings`` setting on ``debug`` mode. + * Yul Optimizer: Prune functions that call each other but are otherwise unreferenced. + * SMTChecker: CHC support to internal function calls. Bugfixes: + * Assembly: Added missing `source` field to legacy assembly json output to complete the source reference. * Parser: Fix an internal error for ``abstract`` without ``contract``. - + * Type Checker: Make invalid calls to uncallable types fatal errors instead of regular. ### 0.6.2 (2020-01-27) @@ -95,6 +1119,12 @@ Compiler Features: * ABIEncoderV2: Do not warn about enabled ABIEncoderV2 anymore (the pragma is still needed, though). +### 0.5.17 (2020-03-17) + +Bugfixes: + * Type Checker: Disallow overriding of private functions. + + ### 0.5.16 (2020-01-02) Backported Bugfixes: @@ -1270,7 +2300,7 @@ Features: * Internal: Inline assembly usable by the code generator. * Commandline interface: Using ``-`` as filename allows reading from stdin. * Interface JSON: Fallback function is now part of the ABI. - * Interface: Version string now *semver* compatible. + * Interface: Version string now *SemVer* compatible. * Code generator: Do not provide "new account gas" if we know the called account exists. Bugfixes: diff --git a/compiler/README.md b/compiler/README.md new file mode 100644 index 00000000..9637503b --- /dev/null +++ b/compiler/README.md @@ -0,0 +1,92 @@ +# The Solidity Contract-Oriented Programming Language + +[![Matrix Chat](https://img.shields.io/badge/Matrix%20-chat-brightgreen?style=plastic&logo=matrix)](https://matrix.to/#/#ethereum_solidity:gitter.im) +[![Gitter Chat](https://img.shields.io/badge/Gitter%20-chat-brightgreen?style=plastic&logo=gitter)](https://gitter.im/ethereum/solidity) +[![Solidity Forum](https://img.shields.io/badge/Solidity_Forum%20-discuss-brightgreen?style=plastic&logo=discourse)](https://forum.soliditylang.org/) +[![Twitter Follow](https://img.shields.io/twitter/follow/solidity_lang?style=plastic&logo=twitter)](https://twitter.com/solidity_lang) +[![Mastodon Follow](https://img.shields.io/mastodon/follow/000335908?domain=https%3A%2F%2Ffosstodon.org%2F&logo=mastodon&style=plastic)](https://fosstodon.org/@solidity) + +You can talk to us on Gitter and Matrix, tweet at us on Twitter or create a new topic in the Solidity forum. Questions, feedback, and suggestions are welcome! + +Solidity is a statically typed, contract-oriented, high-level language for implementing smart contracts on the Ethereum platform. + +For a good overview and starting point, please check out the official [Solidity Language Portal](https://soliditylang.org). + +## Table of Contents + +- [Background](#background) +- [Build and Install](#build-and-install) +- [Example](#example) +- [Documentation](#documentation) +- [Development](#development) +- [Maintainers](#maintainers) +- [License](#license) +- [Security](#security) + +## Background + +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 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 +introduced regularly. We currently use a 0.x version +number [to indicate this fast pace of change](https://semver.org/#spec-item-4). + +## Build and Install + +Instructions about how to build and install the Solidity compiler can be +found in the [Solidity documentation](https://docs.soliditylang.org/en/latest/installing-solidity.html#building-from-source). + + +## Example + +A "Hello World" program in Solidity is of even less use than in other languages, but still: + +```solidity +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.0 <0.9.0; + +contract HelloWorld { + function helloWorld() external pure returns (string memory) { + return "Hello, World!"; + } +} +``` + +To get started with Solidity, you can use [Remix](https://remix.ethereum.org/), which is a +browser-based IDE. Here are some example contracts: + +1. [Voting](https://docs.soliditylang.org/en/latest/solidity-by-example.html#voting) +2. [Blind Auction](https://docs.soliditylang.org/en/latest/solidity-by-example.html#blind-auction) +3. [Safe remote purchase](https://docs.soliditylang.org/en/latest/solidity-by-example.html#safe-remote-purchase) +4. [Micropayment Channel](https://docs.soliditylang.org/en/latest/solidity-by-example.html#micropayment-channel) + +## Documentation + +The Solidity documentation is hosted at [Read the docs](https://docs.soliditylang.org). + +## Development + +Solidity is still under development. Contributions are always welcome! +Please follow the +[Developers Guide](https://docs.soliditylang.org/en/latest/contributing.html) +if you want to help. + +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) + +## License +Solidity is licensed under [GNU General Public License v3.0](LICENSE.txt). + +Some third-party code has its [own licensing terms](cmake/templates/license.h.in). + +## Security + +The security policy may be [found here](SECURITY.md). diff --git a/compiler/ReleaseChecklist.md b/compiler/ReleaseChecklist.md index b6422654..e1a6a4c1 100644 --- a/compiler/ReleaseChecklist.md +++ b/compiler/ReleaseChecklist.md @@ -1,52 +1,86 @@ ## 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-blog](https://github.com/ethereum/solidity-blog) and [solidity-portal](https://github.com/ethereum/solidity-portal) repositories. + - [ ] DockerHub account with push rights to the [``solc`` image](https://hub.docker.com/r/ethereum/solc). + - [ ] Lauchpad (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). + - [ ] [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). -### Pre-release - - [ ] Ensure that a Github project exists for the release. - - [ ] Check that all issues and pull requests from the Github project to be released are merged to ``develop``. +### Blog Post + - [ ] Create a post on [solidity-blog](https://github.com/ethereum/solidity-blog) in the ``Releases`` category and explain some of the new features or concepts. + - [ ] Create a post on [solidity-blog](https://github.com/ethereum/solidity-blog) in the ``Security Alerts`` category in case of important bug(s). + +### 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. ### 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 ``release`` branch as new target and set tag to the new version (e.g. `v0.5.4`) (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 origin/release..origin/develop``). - - [ ] Create a pull request from ``develop`` to ``release``, wait for the tests, then merge it. - - [ ] Make a final check that there are no platform-dependency issues in the ``solidity-test-bytecode`` repository. - - [ ] Wait for the tests for the commit on ``release``, create a release in Github, creating the tag (click the `PUBLISH RELEASE` button on the release page.) - - [ ] Wait for the CI runs on the tag itself (travis and appveyor should push artifacts onto the Github release page). - - [ ] Run ``scripts/create_source_tarball.sh`` while being on the tag to create the source tarball. Make sure to create ``prerelease.txt`` before: (``echo -n > prerelease.txt``). This will create the tarball in a directory called ``upload``. + - [ ] 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.**``. + Don't publish it yet - click the ``Save draft`` button instead. + - [ ] Thank voluntary contributors in the Github release notes (use ``git shortlog --summary --email v0.5.3..origin/develop``). + - [ ] Check that all tests on the latest commit in ``develop`` are green. + - [ ] Click the ``Publish release`` button on the release page, creating the tag. + - [ ] Wait for the CI runs on the tag itself. + +### 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 ``./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. -### PPA - - [ ] Change ``scripts/release_ppa.sh`` to match your key's email and key id. - - [ ] Run ``scripts/release_ppa.sh release`` 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`` and ``Xenial`` while selecting ``Copy existing binaries``. - - [ ] Check that the Docker release was pushed to Docker Hub (this still seems to have problems, run ``./scripts/docker_deploy_manual.sh v0.x.x``). +### Homebrew and MacOS + - [ ] 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). -### Homebrew - - [ ] Update the version and the hash (``sha256sum solidity_x.x.x.tar.gz``) in https://github.com/ethereum/homebrew-ethereum/blob/master/solidity.rb +### Docker + - [ ] Run ``./scripts/docker_deploy_manual.sh v$VERSION``. -### Documentation - - [ ] Build the new version on https://readthedocs.org/projects/solidity/ (select `latest` on 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. +### PPA + - [ ] 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. + If not, run ``scripts/deps-ppa/static-z3.sh`` (after changing email address and key id) and wait for the builds to succeed before continuing. + - [ ] Run ``scripts/release_ppa.sh v$VERSION`` to create the PPA release. + - [ ] Wait for the [``~ethereum/ethereum-static`` PPA](https://launchpad.net/~ethereum/+archive/ubuntu/ethereum-static) 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/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. - [ ] Increment the version number, create a pull request for that, merge it after tests succeeded. - - [ ] Run ``npm publish`` in the updated ``solc-js`` repository. - - [ ] Make sure to push the tag ``npm publish`` created with ``git push --tags``. + - [ ] Run ``npm run build:tarball`` in the updated ``solc-js`` repository to create ``solc-.tgz``. Inspect the tarball to ensure that it contains an up to date compiler binary. + - [ ] Run ``npm run publish:tarball`` to publish the newly created tarball. + - [ ] Create a tag using ``git tag --annotate v$VERSION`` and push it with ``git push --tags``. ### Post-release + - [ ] 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. + - [ ] Publish the blog posts. - [ ] Create a commit to increase the version number on ``develop`` in ``CMakeLists.txt`` and add a new skeleton changelog entry. - - [ ] Merge ``release`` back into ``develop``. - - [ ] Announce on Twitter and Reddit. + - [ ] Announce on Twitter, including links to the release and the blog post. + Use ``#xp`` at the end of the tweet to automatically cross post the announcement to Fosstodon. + - [ ] 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 the [Solidity forum](https://forum.soliditylang.org) in the ``Announcements`` category. + - [ ] 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 :) diff --git a/compiler/SECURITY.md b/compiler/SECURITY.md new file mode 100644 index 00000000..d319b332 --- /dev/null +++ b/compiler/SECURITY.md @@ -0,0 +1,52 @@ +# Security Policy + +The Solidity team and community take all security bugs in Solidity seriously. +We appreciate your efforts and responsible disclosure and will make every effort to acknowledge your contributions. + +## Scope + +Bugs in the Solidity repository are in scope. +Bugs in third-party dependencies e.g., jsoncpp, boost etc. are not in scope unless they result in a Solidity specific bug. + +Only bugs that have a demonstrable security impact on smart contracts are in scope. +For example, a Solidity program whose optimization is incorrect (e.g., leads to an incorrect output) qualifies as a security bug. +Please note that the [rules][2] of the [Ethereum bounty program][1] have precedence over this security policy. + +## Supported Versions + +As a general rule, only the latest release gets security updates. +Exceptions may be made when the current breaking release is relatively new, e.g. less than three months old. +If you are reporting a bug, please state clearly the Solidity version(s) it affects. + +Example 1: Assuming the current release is `0.6.3` and a security bug has been found in it that affects both `0.5.x` and `0.6.x` trees, we may not only patch `0.6.3` (the bug-fix release numbered `0.6.4`) but `0.5.x` as well (the bug-fix release numbered `0.5.(x+1)`). + +Example 2: Assuming the current release is `0.6.25` and a security bug has been found in it, we may only patch `0.6.25` (in the bug-fix release numbered `0.6.26`) even if the bug affects a previous tree such as `0.5.x`. + +## Reporting a Vulnerability + +To report a vulnerability, please follow the instructions stated in the [Ethereum bounty program][1]. + +In the bug report, please include all details necessary to reproduce the vulnerability such as: + +- Input program that triggers the bug +- Compiler version affected +- Target EVM version +- Framework/IDE if applicable +- EVM execution environment/client if applicable +- Operating system + +Please include steps to reproduce the bug you have found in as much detail as possible. + +Once we have received your bug report, we will try to reproduce it and provide a more detailed response. +Once the reported bug has been successfully reproduced, the Solidity team will work on a fix. + +The Solidity team maintains the following JSON-formatted lists of patched security vulnerabilities: + +- [Summary of known security vulnerabilities][3] +- [List of security vulnerabilities affecting a specific version of the compiler][4]. + + +[1]: https://bounty.ethereum.org/ +[2]: https://bounty.ethereum.org/#rules +[3]: https://docs.soliditylang.org/en/develop/bugs.html +[4]: https://github.com/ethereum/solidity/blob/develop/docs/bugs_by_version.json diff --git a/compiler/appveyor.yml b/compiler/appveyor.yml deleted file mode 100644 index 2e2a2fa8..00000000 --- a/compiler/appveyor.yml +++ /dev/null @@ -1,110 +0,0 @@ -#------------------------------------------------------------------------------ -# Appveyor configuration file for solidity. -# -# The documentation for solidity is hosted at: -# -# http://solidity.readthedocs.org -# -# ------------------------------------------------------------------------------ -# 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 -# -# (c) 2016 solidity contributors. -#------------------------------------------------------------------------------ - -branches: - only: - - release - - develop -configuration: - - Release -environment: - matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - # This is used for pushing to solidity-test-bytecodes - priv_key: - secure: yYGwg4rhCdHfwuv2mFjaNEDwAx3IKUbp0D5fMGpaKefnfk+BiMS5bqSHRiOj91PZ91P9pUk2Vu+eNuS4hTFCf1zFGfrOhlJ4Ij0xSyU5m/LQr590Mo+f7W94Xc8ubgo6j2hp9qH/szTqTzmAkmxKO5TLlWjVzVny2t/s5o5UprLS1/MdzDNLjpVNXR03oKfdWUV9a2l6+PejXCbqyUCagh6BByZqeAPbDcil6eAfxu4EPX83Fuurof+KqFzIWycBG5qK1pTipn2pxiA0QKuUrD8y8VNL0S23NTgxoxSp7nPVMd3K0qRSzPM5lrqS7Z8i3evkVwPbuhu0gSiV08jGVahH2snQ3JGYsH2D4KmVn/xiVBeJ0lRplYlfZF0GUu7iJ+DDxi6wBPhW9A25/NyD/mx7Ub2dLheyWi8AjdSCzhfRD+4We8FQQeHRo3Q0kAohFmlCXdXhrcwOOloId8r6xYwg+hWxHTt2Oe9CKwXfmiPjgl/Gd6lYgLpyyfJ8drQ6tjO/pybLEa10v74qYNdVW5LaLIsRUM9Jm/FDVTrOGYtPndi87mF+/tBJIaXXNz0EMl5xvsKW0SBfUMV49zoDDKZZgWyO9U/cfViEUi7Sdn9QLsBWLZfSgBQNkq3WGZVKPq58OxEWT9dUghQHlSVh2qWF/NUx0TRBjiJl9JM56ENTMD00y18eDcXNCeLLVYB+R1axabUPdXivrO+BrWQK94IWxKEJ+YYN8WVJWAO5T/EBDKwgiXGneePwJ75WP7XCLtuYxqjC+CeW3xBVCzCEeZB/VVBvt7fhmtcoeZZ6tAS10h0yY5WWZ/EUVorj+c/FrMm7Nlpcrd1p4hciffePSLVg+yvy9/xTuM9trYWMgj4xcDQbYsaeItHO2Z3EiUoCgNdUw6rONiNwS/XBApWhCcklWm0/g62h2gOa7/hnKG6p2omQzYw+cOzWbF9+DBzoTSXXZXqbUshVee+CD+iYJKleGYSdbMdM89HW4HyskHk6HgM1ggE8CsgD1pMhXtqLTYZBlvsZCBkHPkD9NhGD2DtrNOmJOW8xwkL2/Il6roDF4n856XNdsjvd++rvQoKr58SkyApCJeCo3sfVres0W22g+7If2b2kWC4/DphrFkeaceFzJOctBUrwstvQBXIVOcadU978A3E7jvTaMR4JL9kC/iPOUVNjNRNM/gNvTlf3CIyMMszFeftjEBGnCZaSpht2RtNapRQQb6QPkOP88nufQVZq/TP1ECmvdTUWJ7kSnAupu6u8oH2x2IIm/KKeIwSYU5rGxjRb36DwgXCHcwfRYo3VNorwTeZGj4q1TSM9PuvgzNg//gKZW6VRa+HdNm/40ZGpDsOrr55tOBqfpq9k5RmevqW/OMZS3xUuArKdYLQY75t9eWcbHSgFN2ZY1KEdyEEvVKgs6Q4lEnSSulGxroRxTU5BOoA0V4tCeCUoSPD3FB93WsO9fBPzNsqOuBtDdIkApefzc1pT38uKpmVfggKUsoWUdqMXAWqCDWr2uw9EE900RJpEY6mIEWhkcro5LAMwaqByOGpqFFUkH+UWTC102eVHEmjxKpC6c6cSzoKKU6Ckd+jVRFO7TvmVe1MKCwjXj8lcAfAM2gQ+XehtrQdIBhAmCrnzurfz2u9tKVdpiADC1ig+kMs1/HX2713LYVXzDKdk+duQ94SVtGv9F2Iv+KN5oq4UFgll6VGt7GHsJOrYYf/wrOfB09IkpmjNygvcpmmSdcXXF8ulDD6KHTGEGUlFwLOpEwKx+zX2ZvviStHhN8KsoTKSVSueDmSSI63HdTS7FxfrHJc1yAzsdqEN5g5eV/z2Fn34qy64mdFSAZMF5zsbWZYFpc9ef3llF5aRcuD90JWT2VC7rB2jeGEtiwGkDlqKzxqRvJk06wTK6+n5RncN66bDaksulOPJMAR/bRW7dinV8T6yIvybuhqDetxJQP6eyAnW4xr1YxIAG4BXGZV6XAPTgOG2oGvMdncxkcLQHXVu07x39ySqP/m2MBxn0zF3DmaqrSPIRMhS8gG3d/23Jux3YHDEOBHjdJSdwqs5F5+QBFPV2rmJnpcSoW4d3M119XI20L914c62R7wY4e6+qmi3ydQU9g6p8psZgaE3TuMsyzX3k4C30nC/3gWT+zl253NjZwfbzIdHu5LWNDY9kEHtKzLP -# NB: Appveyor cache is disabled, because it is proving very unreliable. -# We can re-enable it when we find a way to mitigate the unreliability -# issues. Have automated builds be reliable is the more important thing. -#cache: build -# -# In case we'd need a RDP detail to login into appveyor -#init: -# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) -install: - - ps: if ($env:priv_key) { - $fileContent = "-----BEGIN RSA PRIVATE KEY-----`n"; - $fileContent += $env:priv_key.Replace(' ', "`n"); - $fileContent += "`n-----END RSA PRIVATE KEY-----`n"; - Set-Content c:\users\appveyor\.ssh\id_rsa $fileContent - } - - ps: $prerelease = "nightly." - - ps: $prerelease += Get-Date -format "yyyy.M.d" - - ps: if($env:appveyor_repo_branch -eq 'release') { Set-Content prerelease.txt $null } else { Set-Content prerelease.txt $prerelease } - - scripts/install_deps.bat - - set ETHEREUM_DEPS_PATH=%APPVEYOR_BUILD_FOLDER%\deps\install -before_build: - - if not exist build mkdir build - - cd build - - cmake -G "Visual Studio 15 2017 Win64" .. -DTESTS=On -build_script: - - msbuild solidity.sln /p:Configuration=%CONFIGURATION% /m:%NUMBER_OF_PROCESSORS% /v:minimal - - cd %APPVEYOR_BUILD_FOLDER% - - scripts\release.bat %CONFIGURATION% 2017 - - ps: $bytecodedir = git show -s --format="%cd-%H" --date=short - -test_script: - - cd %APPVEYOR_BUILD_FOLDER%\build\test\%CONFIGURATION% - - soltest.exe --show-progress -- --testpath %APPVEYOR_BUILD_FOLDER%\test --no-smt -# Skip bytecode compare if private key is not available - - cd %APPVEYOR_BUILD_FOLDER% - - ps: if ($env:priv_key) { - scripts\bytecodecompare\storebytecode.bat $Env:CONFIGURATION $bytecodedir - } - - cd %APPVEYOR_BUILD_FOLDER%\build\test\%CONFIGURATION% - -artifacts: - - path: solidity-windows.zip - name: solidity-windows-zip - -# This is the deploy target for Windows which generates ZIPs per commit. -# We are in agreement that generating ZIPs per commit for the develop -# branch is probably just noise, so we only run this deployment target -# on 'release'. -# -# See https://www.appveyor.com/docs/deployment/github for information -# on GitHub Releases in Appveyor. -# -# You need to generate a GitHub personal access token for Appveyor -# See https://github.com/settings/tokens for more information on that. -# The token you generate there (in an encrypted form) is what is -# passed to this deployment target in the 'auth_token' parameter -# below. - -deploy: - provider: GitHub - auth_token: - secure: HPjiugbDSCsEFTphj/qwHuSw80/BV1xWoSvj95CPmtb16Ukh2VQbLVB7iFtZSans - artifact: solidity-windows-zip - on: - branch: release - appveyor_repo_tag: true - -notifications: - - provider: GitHubPullRequest - on_build_success: false - on_build_failure: false - on_build_status_changed: false diff --git a/compiler/cmake/EthCompilerSettings.cmake b/compiler/cmake/EthCompilerSettings.cmake index 543b52b0..9803818d 100644 --- a/compiler/cmake/EthCompilerSettings.cmake +++ b/compiler/cmake/EthCompilerSettings.cmake @@ -16,27 +16,63 @@ include(EthCheckCXXCompilerFlag) -eth_add_cxx_compiler_flag_if_supported(-fstack-protector-strong have_stack_protector_strong_support) -if(NOT have_stack_protector_strong_support) - eth_add_cxx_compiler_flag_if_supported(-fstack-protector) +if(NOT EMSCRIPTEN) + eth_add_cxx_compiler_flag_if_supported(-fstack-protector-strong have_stack_protector_strong_support) + if(NOT have_stack_protector_strong_support) + eth_add_cxx_compiler_flag_if_supported(-fstack-protector) + 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") +# -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. +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. +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(-Wno-unknown-pragmas) - add_compile_options(-Wimplicit-fallthrough) + 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) # TODO return this after +# add_compile_options(-Wconversion) # TODO return this after + + check_cxx_compiler_flag(-Wextra-semi WEXTRA_SEMI) + if(WEXTRA_SEMI) + add_compile_options($<$:-Wextra-semi>) + 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") @@ -46,12 +82,9 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA # Additional GCC-specific compiler settings. if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") - - # Check that we've got GCC 5.0 or newer. - execute_process( - COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) - if (NOT (GCC_VERSION VERSION_GREATER 5.0 OR GCC_VERSION VERSION_EQUAL 5.0)) - message(FATAL_ERROR "${PROJECT_NAME} requires g++ 5.0 or greater.") + # Check that we've got GCC 8.0 or newer. + if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)) + message(FATAL_ERROR "${PROJECT_NAME} requires g++ 8.0 or greater.") endif () # Use fancy colors in the compiler diagnostics @@ -59,6 +92,11 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA # Additional Clang-specific compiler settings. elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + # Check that we've got clang 7.0 or newer. + if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0)) + message(FATAL_ERROR "${PROJECT_NAME} requires clang++ 7.0 or greater.") + endif () + if ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") # Set stack size to 32MB - by default Apple's clang defines a stack size of 8MB. # Normally 16MB is enough to run all tests, but it will exceed the stack, if -DSANITIZE=address is used. @@ -73,14 +111,6 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA # Some Linux-specific Clang settings. We don't want these for OS X. if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") - - # TODO - Is this even necessary? Why? - # See http://stackoverflow.com/questions/19774778/when-is-it-necessary-to-use-use-the-flag-stdlib-libstdc. - add_compile_options(-stdlib=libstdc++) - - # Tell Boost that we're using Clang's libc++. Not sure exactly why we need to do. - add_definitions(-DBOOST_ASIO_HAS_CLANG_LIBCXX) - # Use fancy colors in the compiler diagnostics add_compile_options(-fcolor-diagnostics) @@ -90,40 +120,39 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA # http://stackoverflow.com/questions/21617158/how-to-silence-unused-command-line-argument-error-with-clang-without-disabling-i add_compile_options(-Qunused-arguments) elseif(EMSCRIPTEN) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --memory-init-file 0") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --memory-init-file 0") # Leave only exported symbols as public and aggressively remove others set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -ffunction-sections -fvisibility=hidden") # Optimisation level set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") # Re-enable exception catching (optimisations above -O1 disable it) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s DISABLE_EXCEPTION_CATCHING=0") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s DISABLE_EXCEPTION_CATCHING=0") # Remove any code related to exit (such as atexit) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_EXIT_RUNTIME=1") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXIT_RUNTIME=0") # Remove any code related to filesystem access - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_FILESYSTEM=1") - # Remove variables even if it needs to be duplicated (can improve speed at the cost of size) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s AGGRESSIVE_VARIABLE_ELIMINATION=1") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s FILESYSTEM=0") # Allow memory growth, but disable some optimisations - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s ALLOW_MEMORY_GROWTH=1") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1") # Disable eval() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_DYNAMIC_EXECUTION=1") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s DYNAMIC_EXECUTION=0") # Disable greedy exception catcher - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NODEJS_CATCH_EXIT=0") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s NODEJS_CATCH_EXIT=0") # Abort if linking results in any undefined symbols # Note: this is on by default in the CMake Emscripten module which we aren't using - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1") # Disallow deprecated emscripten build options. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s STRICT=1") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s STRICT=1") # Export the Emscripten-generated auxiliary methods which are needed by solc-js. # Which methods of libsolc itself are exported is specified in libsolc/CMakeLists.txt. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS=['cwrap','addFunction','removeFunction','UTF8ToString','lengthBytesUTF8','stringToUTF8','setValue']") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS=['cwrap','addFunction','removeFunction','UTF8ToString','lengthBytesUTF8','stringToUTF8','setValue']") # Build for webassembly target. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s WASM=1") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s WASM=1") # Set webassembly build to synchronous loading. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s WASM_ASYNC_COMPILATION=0") - # Output a single js file with the wasm binary embedded as base64 string. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s SINGLE_FILE=1") - + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s WASM_ASYNC_COMPILATION=0") + # Allow new functions to be added to the wasm module via addFunction. + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s ALLOW_TABLE_GROWTH=1") # Disable warnings about not being pure asm.js due to memory growth. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-almost-asm") endif() @@ -131,10 +160,15 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA # The major alternative compiler to GCC/Clang is Microsoft's Visual C++ compiler, only available on Windows. elseif (DEFINED MSVC) + # Remove NDEBUG from RELWITHDEBINFO (to enable asserts) + # CMAKE_CXX_FLAGS_RELWITHDEBINFO for GCC/Clang does not include NDEBUG + string(REPLACE "/DNDEBUG" " " CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") - add_compile_options(/MP) # enable parallel compilation + 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) @@ -145,9 +179,10 @@ elseif (DEFINED MSVC) add_compile_options(/wd4800) # disable forcing value to bool 'true' or 'false' (performance warning) (4800) add_compile_options(-D_WIN32_WINNT=0x0600) # declare Windows Vista API requirement add_compile_options(-DNOMINMAX) # undefine windows.h MAX && MIN macros cause it cause conflicts with std::min && std::max functions - add_compile_options(/utf-8) # enable utf-8 encoding (solves warning 4819) + add_compile_options(/utf-8) # enable utf-8 encoding (solves warning 4819) add_compile_options(-DBOOST_REGEX_NO_LIB) # disable automatic boost::regex library selection add_compile_options(-D_REGEX_MAX_STACK_COUNT=200000L) # increase std::regex recursion depth limit + add_compile_options(/permissive-) # specify standards conformance mode to the compiler # disable empty object file warning set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221") @@ -163,11 +198,41 @@ endif () if (SANITIZE) # Perform case-insensitive string compare - string(TOLOWER "${SANITIZE}" san) + string(TOLOWER "${SANITIZE}" sanitizer) # -fno-omit-frame-pointer gives more informative stack trace in case of an error # -fsanitize-address-use-after-scope throws an error when a variable is used beyond its scope - if (san STREQUAL "address") + if (sanitizer STREQUAL "address") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=address -fsanitize-address-use-after-scope") + elseif (sanitizer STREQUAL "undefined") + # The following flags not used by fuzzer but used by us may create problems, so consider + # disabling them: alignment, pointer-overflow. + # The following flag is not used by us to reduce terminal noise + # i.e., warnings printed on stderr: unsigned-integer-overflow + # Note: The C++ standard does not officially consider unsigned integer overflows + # to be undefined behavior since they are implementation independent. + # Flags are alphabetically sorted and are for clang v10.0 + list(APPEND undefinedSanitizerChecks + alignment + array-bounds + bool + builtin + enum + float-divide-by-zero + function + integer-divide-by-zero + null + object-size + pointer-overflow + return + returns-nonnull-attribute + shift + signed-integer-overflow + unreachable + vla-bound + vptr + ) + list(JOIN undefinedSanitizerChecks "," sanitizerChecks) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${sanitizerChecks} -fno-sanitize-recover=${sanitizerChecks}") endif() endif() @@ -189,6 +254,13 @@ if(COVERAGE) add_compile_options(-g --coverage) endif() +# SMT Solvers integration +option(USE_Z3 "Allow compiling with Z3 SMT solver integration" ON) +if(UNIX AND NOT APPLE) + option(USE_Z3_DLOPEN "Dynamically load the Z3 SMT solver instead of linking against it." OFF) +endif() +option(USE_CVC4 "Allow compiling with CVC4 SMT solver integration" ON) + if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")) option(USE_LD_GOLD "Use GNU gold linker" ON) if (USE_LD_GOLD) diff --git a/compiler/cmake/EthDependencies.cmake b/compiler/cmake/EthDependencies.cmake index d8bca8a3..7a84a01d 100644 --- a/compiler/cmake/EthDependencies.cmake +++ b/compiler/cmake/EthDependencies.cmake @@ -25,10 +25,20 @@ set(ETH_SCRIPTS_DIR ${ETH_CMAKE_DIR}/scripts) ## use multithreaded boost libraries, with -mt suffix set(Boost_USE_MULTITHREADED ON) option(Boost_USE_STATIC_LIBS "Link Boost statically" ON) +if (WIN32) + option(Boost_USE_STATIC_RUNTIME "Link Boost against static C++ runtime libraries" ON) +endif() set(BOOST_COMPONENTS "filesystem;unit_test_framework;program_options;system") -find_package(Boost 1.65.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS}) +if (WIN32) + # Boost 1.77 fixes a bug that causes crashes on Windows for some relative paths in --allow-paths. + # See https://github.com/boostorg/filesystem/issues/201 + find_package(Boost 1.77.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS}) +else() + # Boost 1.65 is the first to also provide boost::get for rvalue-references (#5787). + find_package(Boost 1.65.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS}) +endif() # If cmake is older than boost and boost is older than 1.70, # find_package does not define imported targets, so we have to @@ -48,7 +58,7 @@ foreach (BOOST_COMPONENT IN LISTS BOOST_COMPONENTS) set_property(TARGET Boost::${BOOST_COMPONENT} PROPERTY IMPORTED_LOCATION ${Boost_${BOOST_COMPONENT_UPPER}_LIBRARY}) set_property(TARGET Boost::${BOOST_COMPONENT} PROPERTY INTERFACE_LINK_LIBRARIES ${Boost_${BOOST_COMPONENT_UPPER}_LIBRARIES}) set_property(TARGET Boost::${BOOST_COMPONENT} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS}) - endif() + endif() get_property(LOCATION TARGET Boost::${BOOST_COMPONENT} PROPERTY IMPORTED_LOCATION) message(STATUS "Found Boost::${BOOST_COMPONENT} at ${LOCATION}") endforeach() diff --git a/compiler/cmake/EthPolicy.cmake b/compiler/cmake/EthPolicy.cmake index 4e29898c..eb5c37e2 100644 --- a/compiler/cmake/EthPolicy.cmake +++ b/compiler/cmake/EthPolicy.cmake @@ -15,5 +15,21 @@ macro (eth_policy) # do not interpret if() arguments as variables! cmake_policy(SET CMP0054 NEW) endif() -endmacro() + if (POLICY CMP0091) + # 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() diff --git a/compiler/cmake/EthToolchains.cmake b/compiler/cmake/EthToolchains.cmake index a4263b7d..c2306bd7 100644 --- a/compiler/cmake/EthToolchains.cmake +++ b/compiler/cmake/EthToolchains.cmake @@ -1,3 +1,10 @@ +# Require C++17. +if (NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) # This requires at least CMake 3.8 to accept this C++17 flag. +endif () +set(CMAKE_CXX_STANDARD_REQUIRED TRUE) +set(CMAKE_CXX_EXTENSIONS OFF) + if(NOT CMAKE_TOOLCHAIN_FILE) # Use default toolchain file if none is provided. set( diff --git a/compiler/cmake/EthUtils.cmake b/compiler/cmake/EthUtils.cmake index fca41107..44b92f4a 100644 --- a/compiler/cmake/EthUtils.cmake +++ b/compiler/cmake/EthUtils.cmake @@ -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() diff --git a/compiler/cmake/fmtlib.cmake b/compiler/cmake/fmtlib.cmake new file mode 100644 index 00000000..5ed196ce --- /dev/null +++ b/compiler/cmake/fmtlib.cmake @@ -0,0 +1,20 @@ +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 +) + +if (CMAKE_VERSION VERSION_LESS "3.14.0") + FetchContent_GetProperties(fmtlib) + if (NOT fmtlib_POPULATED) + FetchContent_Populate(fmtlib) + add_subdirectory(${fmtlib_SOURCE_DIR} ${fmtlib_BINARY_DIR}) + endif() +else() + FetchContent_MakeAvailable(fmtlib) +endif() diff --git a/compiler/cmake/jsoncpp.cmake b/compiler/cmake/jsoncpp.cmake index 1377041b..29b8f5f0 100644 --- a/compiler/cmake/jsoncpp.cmake +++ b/compiler/cmake/jsoncpp.cmake @@ -34,22 +34,30 @@ if(CMAKE_VERSION VERSION_GREATER 3.1) set(byproducts BUILD_BYPRODUCTS "${JSONCPP_LIBRARY}") endif() +# Propagate CMAKE_MSVC_RUNTIME_LIBRARY on Windows builds, if set. +if (WIN32 AND POLICY CMP0091 AND CMAKE_MSVC_RUNTIME_LIBRARY) + list(APPEND JSONCPP_CMAKE_ARGS "-DCMAKE_POLICY_DEFAULT_CMP0091:STRING=NEW") + list(APPEND JSONCPP_CMAKE_ARGS "-DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}") +endif() + ExternalProject_Add(jsoncpp-project PREFIX "${prefix}" DOWNLOAD_DIR "${CMAKE_SOURCE_DIR}/deps/downloads" - DOWNLOAD_NAME jsoncpp-1.9.2.tar.gz - URL https://github.com/open-source-parsers/jsoncpp/archive/1.9.2.tar.gz - URL_HASH SHA256=77a402fb577b2e0e5d0bdc1cf9c65278915cdb25171e3452c68b6da8a561f8f0 + 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 CMAKE_COMMAND ${JSONCPP_CMAKE_COMMAND} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_INSTALL_LIBDIR=lib # Build static lib but suitable to be included in a shared lib. -DCMAKE_POSITION_INDEPENDENT_CODE=${BUILD_SHARED_LIBS} + -DJSONCPP_WITH_EXAMPLE=OFF -DJSONCPP_WITH_TESTS=OFF -DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF -DCMAKE_CXX_FLAGS=${JSONCPP_CXX_FLAGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + ${JSONCPP_CMAKE_ARGS} ${byproducts} ) diff --git a/compiler/cmake/range-v3.cmake b/compiler/cmake/range-v3.cmake new file mode 100644 index 00000000..75ed5a92 --- /dev/null +++ b/compiler/cmake/range-v3.cmake @@ -0,0 +1,38 @@ +include(ExternalProject) + +if (${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten") + set(RANGE_V3_CMAKE_COMMAND emcmake cmake) +else() + set(RANGE_V3_CMAKE_COMMAND ${CMAKE_COMMAND}) +endif() + +set(prefix "${CMAKE_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.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= + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DBUILD_TESTING=OFF + -DRANGES_CXX_STD=${CMAKE_CXX_STANDARD} + -DRANGE_V3_DOCS=OFF + -DRANGE_V3_EXAMPLES=OFF + -DRANGE_V3_TESTS=OFF + -DRANGES_BUILD_CALENDAR_EXAMPLE=OFF + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + BUILD_BYPRODUCTS "${RANGE_V3_INCLUDE_DIR}/range/v3/all.hpp" +) + +# Create range-v3 imported library +add_library(range-v3 INTERFACE IMPORTED) +file(MAKE_DIRECTORY ${RANGE_V3_INCLUDE_DIR}) # Must exist. +set_target_properties(range-v3 PROPERTIES + INTERFACE_COMPILE_OPTIONS "\$<\$:/permissive->" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${RANGE_V3_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES ${RANGE_V3_INCLUDE_DIR}) +add_dependencies(range-v3 range-v3-project) diff --git a/compiler/cmake/templates/ewasm_polyfill.in b/compiler/cmake/templates/ewasm_polyfill.in new file mode 100644 index 00000000..8ac36428 --- /dev/null +++ b/compiler/cmake/templates/ewasm_polyfill.in @@ -0,0 +1,13 @@ +// 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 diff --git a/compiler/cmake/templates/license.h.in b/compiler/cmake/templates/license.h.in index 65276d8b..2d7f2691 100644 --- a/compiler/cmake/templates/license.h.in +++ b/compiler/cmake/templates/license.h.in @@ -6,9 +6,34 @@ static std::string const otherLicenses{R"(Most of the code is licensed under GPL parts are as follows: libkeccak-tiny: + The file libsolutil/Keccak256.cpp incorporates libkeccak-tiny. + A single-file implementation of SHA-3 and SHAKE implemented by David Leon Gil License: CC0, attribution kindly requested. Blame taken too, but not liability. +picosha2: + The file libsolutil/picosha2.h is imported. + + Copyright (C) 2017 okdshin + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + jsoncpp: The JsonCpp library's source code, including accompanying documentation, tests and demonstration applications, are licensed under the following @@ -112,6 +137,36 @@ evmc: See the License for the specific language governing permissions and limitations under the License. +mini-lz4: + The file scripts/ci/mini-lz4.js is derived from the emscripten adaptation of + node-lz4 and licensed under the following terms: + + Copyright (c) 2012 Pierre Curto + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +base64: + The file scripts/ci/base64DecToArr.js is derived from a code example + in the MDN Web Docs, which permits use under CC0 terms: + + Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ + All other code is licensed under GPL version 3: diff --git a/compiler/cmake/toolchains/cxx17.cmake b/compiler/cmake/toolchains/cxx17.cmake deleted file mode 100644 index 04a865eb..00000000 --- a/compiler/cmake/toolchains/cxx17.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# Require C++17. -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/compiler/cmake/toolchains/cxx20.cmake b/compiler/cmake/toolchains/cxx20.cmake deleted file mode 100644 index ad34e574..00000000 --- a/compiler/cmake/toolchains/cxx20.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# Require C++20. -set(CMAKE_CXX_STANDARD 20) # This requires at least CMake 3.12 to understand this C++20 flag -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/compiler/cmake/toolchains/default.cmake b/compiler/cmake/toolchains/default.cmake index 07fc80e8..e69de29b 100644 --- a/compiler/cmake/toolchains/default.cmake +++ b/compiler/cmake/toolchains/default.cmake @@ -1,4 +0,0 @@ -# Require C++17. -set(CMAKE_CXX_STANDARD 17) # This requires at least CMake 3.8 to accept this C++17 flag. -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/compiler/cmake/toolchains/emscripten.cmake b/compiler/cmake/toolchains/emscripten.cmake deleted file mode 100644 index 6c29074f..00000000 --- a/compiler/cmake/toolchains/emscripten.cmake +++ /dev/null @@ -1,2 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/default.cmake") -include("$ENV{EMSCRIPTEN}/cmake/Modules/Platform/Emscripten.cmake") diff --git a/compiler/cmake/toolchains/libfuzzer.cmake b/compiler/cmake/toolchains/libfuzzer.cmake index b27f922d..a734df97 100644 --- a/compiler/cmake/toolchains/libfuzzer.cmake +++ b/compiler/cmake/toolchains/libfuzzer.cmake @@ -1,8 +1,15 @@ # Inherit default options include("${CMAKE_CURRENT_LIST_DIR}/default.cmake") +# Enable Z3, disable CVC4 +set(USE_Z3 ON CACHE BOOL "Enable Z3" FORCE) +set(USE_CVC4 OFF CACHE BOOL "Disable CVC4" FORCE) # Build fuzzing binaries set(OSSFUZZ ON CACHE BOOL "Enable fuzzer build" FORCE) # Use libfuzzer as the fuzzing back-end set(LIB_FUZZING_ENGINE "-fsanitize=fuzzer" CACHE STRING "Use libfuzzer back-end" FORCE) -# clang/libfuzzer specific flags for ASan instrumentation -set(CMAKE_CXX_FLAGS "-O1 -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -stdlib=libstdc++" CACHE STRING "Custom compilation flags" FORCE) +# clang/libfuzzer specific flags for UBSan instrumentation +set(CMAKE_CXX_FLAGS "-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -I /usr/local/include/c++/v1 -fsanitize=undefined -fsanitize=fuzzer-no-link -stdlib=libc++" CACHE STRING "Custom compilation flags" FORCE) +# Link statically against boost libraries +set(BOOST_FOUND ON CACHE BOOL "" FORCE) +set(Boost_USE_STATIC_LIBS ON CACHE BOOL "Link against static Boost libraries" FORCE) +set(Boost_USE_STATIC_RUNTIME ON CACHE BOOL "Link against static Boost runtime library" FORCE) diff --git a/compiler/cmake/toolchains/ossfuzz.cmake b/compiler/cmake/toolchains/ossfuzz.cmake index dfa215a2..fb7b8d0b 100644 --- a/compiler/cmake/toolchains/ossfuzz.cmake +++ b/compiler/cmake/toolchains/ossfuzz.cmake @@ -1,5 +1,8 @@ # Inherit default options include("${CMAKE_CURRENT_LIST_DIR}/default.cmake") +# Disable CVC4 and Z3. +set(USE_CVC4 OFF CACHE BOOL "Disable CVC4" FORCE) +set(USE_Z3 OFF CACHE BOOL "Disable Z3" FORCE) # Enable fuzzers set(OSSFUZZ ON CACHE BOOL "Enable fuzzer build" FORCE) set(LIB_FUZZING_ENGINE $ENV{LIB_FUZZING_ENGINE} CACHE STRING "Use fuzzer back-end defined by environment variable" FORCE) diff --git a/compiler/docs/050-breaking-changes.rst b/compiler/docs/050-breaking-changes.rst index ede846cc..3f41ac86 100644 --- a/compiler/docs/050-breaking-changes.rst +++ b/compiler/docs/050-breaking-changes.rst @@ -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``. @@ -127,7 +127,10 @@ For most of the topics the compiler will provide suggestions. adjusted within the type before the conversion. For example, you can convert a ``bytes4`` (4 bytes) to a ``uint64`` (8 bytes) by first converting the ``bytes4`` variable to ``bytes8`` and then to ``uint64``. You get the - opposite padding when converting through ``uint32``. + opposite padding when converting through ``uint32``. Before v0.5.0 any + conversion between ``bytesX`` and ``uintY`` would go through ``uint8X``. For + example ``uint8(bytes3(0x291807))`` would be converted to ``uint8(uint24(bytes3(0x291807)))`` + (the result is ``0x07``). * Using ``msg.value`` in non-payable functions (or introducing it via a modifier) is disallowed as a security feature. Turn the function into @@ -290,10 +293,12 @@ It is still possible to interface with contracts written for Solidity versions p v0.5.0 (or the other way around) by defining interfaces for them. Consider you have the following pre-0.5.0 contract already deployed: -:: +.. code-block:: solidity - // This will not compile with the current version of the compiler + // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.4.25; + // This will report a warning until version 0.4.25 of the compiler + // This will not compile after 0.5.0 contract OldContract { function someOldFunction(uint8 a) { //... @@ -306,9 +311,10 @@ Consider you have the following pre-0.5.0 contract already deployed: This will no longer compile with Solidity v0.5.0. However, you can define a compatible interface for it: -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.5.0 <0.9.0; interface OldContract { function someOldFunction(uint8 a) external; function anotherOldFunction() external returns (bool); @@ -323,9 +329,10 @@ the function will work with ``staticcall``. Given the interface defined above, you can now easily use the already deployed pre-0.5.0 contract: -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.5.0 <0.9.0; interface OldContract { function someOldFunction(uint8 a) external; @@ -343,10 +350,11 @@ Similarly, pre-0.5.0 libraries can be used by defining the functions of the libr supplying the address of the pre-0.5.0 library during linking (see :ref:`commandline-compiler` for how to use the commandline compiler for linking): -:: +.. code-block:: solidity // This will not compile after 0.6.0 - pragma solidity >=0.5.0 <0.5.99; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.5.0; library OldLibrary { function someFunction(uint8 a) public returns(bool); @@ -367,10 +375,11 @@ v0.5.0 with some of the changes listed in this section. Old version: -:: +.. code-block:: solidity - // This will not compile + // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.4.25; + // This will not compile after 0.5.0 contract OtherContract { uint x; @@ -396,7 +405,7 @@ Old version: // Throw is fine in this version. if (x > 100) throw; - bytes b = new bytes(x); + bytes memory b = new bytes(x); y = -3 >> 1; // y == -1 (wrong, should be -2) do { @@ -429,16 +438,18 @@ Old version: New version: -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.5.0; + // This will not compile after 0.6.0 contract OtherContract { uint x; function f(uint y) external { x = y; } - receive() payable external {} + function() payable external {} } contract New { @@ -472,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. @@ -489,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), @@ -505,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)); } } diff --git a/compiler/docs/060-breaking-changes.rst b/compiler/docs/060-breaking-changes.rst index 99e969e0..915a9f33 100644 --- a/compiler/docs/060-breaking-changes.rst +++ b/compiler/docs/060-breaking-changes.rst @@ -16,8 +16,8 @@ This section lists changes where the behaviour 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 - that can hold both the type of the base and the type of the exponent, as with symmentric - operations. Additionally, signed types are allowed for the base of the exponetation. + that can hold both the type of the base and the type of the exponent, as with symmetric + operations. Additionally, signed types are allowed for the base of the exponentiation. Explicitness Requirements @@ -36,13 +36,14 @@ For most of the topics the compiler will provide suggestions. like so: ``override(Base1, Base2)``. * Member-access to ``length`` of arrays is now always read-only, even for storage arrays. It is no - longer possible to resize storage arrays assigning a new value to their length. Use ``push()``, - ``push(value)`` or ``pop()`` instead, or assign a full array, which will of course overwrite existing content. - The reason behind this is to prevent storage collisions by gigantic + longer possible to resize storage arrays by assigning a new value to their length. Use ``push()``, + ``push(value)`` or ``pop()`` instead, or assign a full array, which will of course overwrite the existing content. + The reason behind this is to prevent storage collisions of gigantic storage arrays. * The new keyword ``abstract`` can be used to mark contracts as abstract. It has to be used - if a contract does not implement all its functions. + if a contract does not implement all its functions. Abstract contracts cannot be created using the ``new`` operator, + and it is not possible to generate bytecode for them during compilation. * Libraries have to implement all their functions, not only the internal ones. @@ -86,16 +87,16 @@ New Features ============ This section lists things that were not possible prior to Solidity 0.6.0 -or at least were more difficult to achieve prior to Solidity 0.6.0. +or were more difficult to achieve. - * The :ref:`try/catch statement ` allows you to react on failed external calls. - * ``struct`` and ``enum`` types can be declared at file level. - * Array slices can be used for calldata arrays, for example ``abi.decode(msg.data[4:], (uint, uint))`` - is a low-level way to decode the function call payload. - * Natspec supports multiple return parameters in developer documentation, enforcing the same naming check as ``@param``. - * Yul and Inline Assembly have a new statement called ``leave`` that exits the current function. - * Conversions from ``address`` to ``address payable`` are now possible via ``payable(x)``, where - ``x`` must be of type ``address``. +* The :ref:`try/catch statement ` allows you to react on failed external calls. +* ``struct`` and ``enum`` types can be declared at file level. +* Array slices can be used for calldata arrays, for example ``abi.decode(msg.data[4:], (uint, uint))`` + is a low-level way to decode the function call payload. +* Natspec supports multiple return parameters in developer documentation, enforcing the same naming check as ``@param``. +* Yul and Inline Assembly have a new statement called ``leave`` that exits the current function. +* Conversions from ``address`` to ``address payable`` are now possible via ``payable(x)``, where + ``x`` must be of type ``address``. Interface Changes @@ -103,7 +104,7 @@ 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 -interface or how you analyze the output produced by it. +interface, or how you analyze the output produced by it. New Error Reporter ~~~~~~~~~~~~~~~~~~ @@ -131,7 +132,7 @@ Yul Optimizer Together with the legacy bytecode optimizer, the :doc:`Yul ` optimizer is now enabled by default when you call the compiler with ``--optimize``. It can be disabled by calling the compiler with ``--no-optimize-yul``. -This mostly affects code that uses ABIEncoderV2. +This mostly affects code that uses ABI coder v2. C API Changes ~~~~~~~~~~~~~ @@ -166,7 +167,7 @@ This section gives detailed instructions on how to update prior code for every b documentation so long as the notices are in the order they appear in the tuple return type. * Choose unique identifiers for variable declarations in inline assembly that do not conflict - with declartions outside the inline assembly block. + with declarations outside the inline assembly block. * Add ``virtual`` to every non-interface function you intend to override. Add ``virtual`` to all functions without implementation outside interfaces. For single inheritance, add diff --git a/compiler/docs/070-breaking-changes.rst b/compiler/docs/070-breaking-changes.rst new file mode 100644 index 00000000..05e98a4d --- /dev/null +++ b/compiler/docs/070-breaking-changes.rst @@ -0,0 +1,133 @@ +******************************** +Solidity v0.7.0 Breaking Changes +******************************** + +This section highlights the main breaking changes introduced in Solidity +version 0.7.0, along with the reasoning behind the changes and how to update +affected code. +For the full list check +`the release changelog `_. + + +Silent Changes of the Semantics +=============================== + +* Exponentiation and shifts of literals by non-literals (e.g. ``1 << x`` or ``2 ** x``) + will always use either the type ``uint256`` (for non-negative literals) or + ``int256`` (for negative literals) to perform the operation. + Previously, the operation was performed in the type of the shift amount / the + exponent which can be misleading. + + +Changes to the Syntax +===================== + +* In external function and contract creation calls, Ether and gas is now specified using a new syntax: + ``x.f{gas: 10000, value: 2 ether}(arg1, arg2)``. + The old syntax -- ``x.f.gas(10000).value(2 ether)(arg1, arg2)`` -- will cause an error. + +* The global variable ``now`` is deprecated, ``block.timestamp`` should be used instead. + The single identifier ``now`` is too generic for a global variable and could give the impression + that it changes during transaction processing, whereas ``block.timestamp`` correctly + reflects the fact that it is just a property of the block. + +* NatSpec comments on variables are only allowed for public state variables and not + for local or internal variables. + +* The token ``gwei`` is a keyword now (used to specify, e.g. ``2 gwei`` as a number) + and cannot be used as an identifier. + +* String literals now can only contain printable ASCII characters and this also includes a variety of + escape sequences, such as hexadecimal (``\xff``) and unicode escapes (``\u20ac``). + +* Unicode string literals are supported now to accommodate valid UTF-8 sequences. They are identified + with the ``unicode`` prefix: ``unicode"Hello 😃"``. + +* State Mutability: The state mutability of functions can now be restricted during inheritance: + Functions with default state mutability can be overridden by ``pure`` and ``view`` functions + while ``view`` functions can be overridden by ``pure`` functions. + At the same time, public state variables are considered ``view`` and even ``pure`` + if they are constants. + + + +Inline Assembly +--------------- + +* Disallow ``.`` in user-defined function and variable names in inline assembly. + It is still valid if you use Solidity in Yul-only mode. + +* Slot and offset of storage pointer variable ``x`` are accessed via ``x.slot`` + and ``x.offset`` instead of ``x_slot`` and ``x_offset``. + +Removal of Unused or Unsafe Features +==================================== + +Mappings outside Storage +------------------------ + +* If a struct or array contains a mapping, it can only be used in storage. + Previously, mapping members were silently skipped in memory, which + is confusing and error-prone. + +* Assignments to structs or arrays in storage does not work if they contain + mappings. + Previously, mappings were silently skipped during the copy operation, which + is misleading and error-prone. + +Functions and Events +-------------------- + +* Visibility (``public`` / ``internal``) is not needed for constructors anymore: + To prevent a contract from being created, it can be marked ``abstract``. + This makes the visibility concept for constructors obsolete. + +* Type Checker: Disallow ``virtual`` for library functions: + Since libraries cannot be inherited from, library functions should not be virtual. + +* Multiple events with the same name and parameter types in the same + inheritance hierarchy are disallowed. + +* ``using A for B`` only affects the contract it is mentioned in. + Previously, the effect was inherited. Now, you have to repeat the ``using`` + statement in all derived contracts that make use of the feature. + +Expressions +----------- + +* Shifts by signed types are disallowed. + Previously, shifts by negative amounts were allowed, but reverted at runtime. + +* The ``finney`` and ``szabo`` denominations are removed. + They are rarely used and do not make the actual amount readily visible. Instead, explicit + values like ``1e20`` or the very common ``gwei`` can be used. + +Declarations +------------ + +* The keyword ``var`` cannot be used anymore. + Previously, this keyword would parse but result in a type error and + a suggestion about which type to use. Now, it results in a parser error. + +Interface Changes +================= + +* JSON AST: Mark hex string literals with ``kind: "hexString"``. +* JSON AST: Members with value ``null`` are removed from JSON output. +* NatSpec: Constructors and functions have consistent userdoc output. + + +How to update your code +======================= + +This section gives detailed instructions on how to update prior code for every breaking change. + +* Change ``x.f.value(...)()`` to ``x.f{value: ...}()``. Similarly ``(new C).value(...)()`` to + ``new C{value: ...}()`` and ``x.f.gas(...).value(...)()`` to ``x.f{gas: ..., value: ...}()``. +* Change ``now`` to ``block.timestamp``. +* Change types of right operand in shift operators to unsigned types. For example change ``x >> (256 - y)`` to + ``x >> uint(256 - y)``. +* Repeat the ``using A for B`` statements in all derived contracts if needed. +* Remove the ``public`` keyword from every constructor. +* Remove the ``internal`` keyword from every constructor and add ``abstract`` to the contract (if not already present). +* Change ``_slot`` and ``_offset`` suffixes in inline assembly to ``.slot`` and ``.offset``, respectively. diff --git a/compiler/docs/080-breaking-changes.rst b/compiler/docs/080-breaking-changes.rst new file mode 100644 index 00000000..b322d2a4 --- /dev/null +++ b/compiler/docs/080-breaking-changes.rst @@ -0,0 +1,176 @@ +******************************** +Solidity v0.8.0 Breaking Changes +******************************** + +This section highlights the main breaking changes introduced in Solidity +version 0.8.0. +For the full list check +`the release changelog `_. + +Silent Changes of the Semantics +=============================== + +This section lists changes where existing code changes its behaviour without +the compiler notifying you about it. + +* Arithmetic operations revert on underflow and overflow. You can use ``unchecked { ... }`` to use + the previous wrapping behaviour. + + 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;``. + 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. + + Note that ABI coder v2 supports more types than v1 and performs more sanity checks on the inputs. + ABI coder v2 makes some function calls more expensive and it can also make contract calls + revert that did not revert with ABI coder v1 when they contain data that does not conform to the + parameter types. + +* Exponentiation is right associative, i.e., the expression ``a**b**c`` is parsed as ``a**(b**c)``. + Before 0.8.0, it was parsed as ``(a**b)**c``. + + This is the common way to parse the exponentiation operator. + +* Failing assertions and other internal checks like division by zero or arithmetic overflow do + not use the invalid opcode but instead the revert opcode. + More specifically, they will use error data equal to a function call to ``Panic(uint256)`` with an error code specific + to the circumstances. + + This will save gas on errors while it still allows static analysis tools to distinguish + these situations from a revert on invalid input, like a failing ``require``. + +* If a byte array in storage is accessed whose length is encoded incorrectly, a panic is caused. + A contract cannot get into this situation unless inline assembly is used to modify the raw representation of storage byte arrays. + +* If constants are used in array length expressions, previous versions of Solidity would use arbitrary precision + in all branches of the evaluation tree. Now, if constant variables are used as intermediate expressions, + their values will be properly rounded in the same way as when they are used in run-time expressions. + +* The type ``byte`` has been removed. It was an alias of ``bytes1``. + +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 + the following cases was likely ambiguous: + + 1. Explicit conversions from negative literals and literals larger than ``type(uint160).max`` to + ``address`` are disallowed. + 2. Explicit conversions between literals and an integer type ``T`` are only allowed if the literal + lies between ``type(T).min`` and ``type(T).max``. In particular, replace usages of ``uint(-1)`` + with ``type(uint).max``. + 3. Explicit conversions between literals and enums are only allowed if the literal can + represent a value in the enum. + 4. Explicit conversions between literals and ``address`` type (e.g. ``address(literal)``) have the + type ``address`` instead of ``address payable``. One can get a payable address type by using an + explicit conversion, i.e., ``payable(literal)``. + +* :ref:`Address literals` have the type ``address`` instead of ``address + payable``. They can be converted to ``address payable`` by using an explicit conversion, e.g. + ``payable(0xdCad3a6d3569DF655070DEd06cb7A1b2Ccd1D3AF)``. + +* There are new restrictions on explicit type conversions. The conversion is only allowed when there + is at most one change in sign, width or type-category (``int``, ``address``, ``bytesNN``, etc.). + To perform multiple changes, use multiple conversions. + + Let us use the notation ``T(S)`` to denote the explicit conversion ``T(x)``, where, ``T`` and + ``S`` are types, and ``x`` is any arbitrary variable of type ``S``. An example of such a + disallowed conversion would be ``uint16(int8)`` since it changes both width (8 bits to 16 bits) + and sign (signed integer to unsigned integer). In order to do the conversion, one has to go + through an intermediate type. In the previous example, this would be ``uint16(uint8(int8))`` or + ``uint16(int16(int8))``. Note that the two ways to convert will produce different results e.g., + for ``-1``. The following are some examples of conversions that are disallowed by this rule. + + - ``address(uint)`` and ``uint(address)``: converting both type-category and width. Replace this by + ``address(uint160(uint))`` and ``uint(uint160(address))`` respectively. + - ``payable(uint160)``, ``payable(bytes20)`` and ``payable(integer-literal)``: converting both + type-category and state-mutability. Replace this by ``payable(address(uint160))``, + ``payable(address(bytes20))`` and ``payable(address(integer-literal))`` respectively. Note that + ``payable(0)`` is valid and is an exception to the rule. + - ``int80(bytes10)`` and ``bytes10(int80)``: converting both type-category and sign. Replace this by + ``int80(uint80(bytes10))`` and ``bytes10(uint80(int80)`` respectively. + - ``Contract(uint)``: converting both type-category and width. Replace this by + ``Contract(address(uint160(uint)))``. + + These conversions were disallowed to avoid ambiguity. For example, in the expression ``uint16 x = + uint16(int8(-1))``, the value of ``x`` would depend on whether the sign or the width conversion + was applied first. + +* Function call options can only be given once, i.e. ``c.f{gas: 10000}{value: 1}()`` is invalid and has to be changed to ``c.f{gas: 10000, value: 1}()``. + +* 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. + +* ``enum`` definitions cannot contain more than 256 members. + + This will make it safe to assume that the underlying type in the ABI is always ``uint8``. + +* Declarations with the name ``this``, ``super`` and ``_`` are disallowed, with the exception of + public functions and events. The exception is to make it possible to declare interfaces of contracts + implemented in languages other than Solidity that do permit such function names. + +* Remove support for the ``\b``, ``\f``, and ``\v`` escape sequences in code. + They can still be inserted via hexadecimal escapes, e.g. ``\x08``, ``\x0c``, and ``\x0b``, respectively. + +* The global variables ``tx.origin`` and ``msg.sender`` have the type ``address`` instead of + ``address payable``. One can convert them into ``address payable`` by using an explicit + conversion, i.e., ``payable(tx.origin)`` or ``payable(msg.sender)``. + + This change was done since the compiler cannot determine whether or not these addresses + are payable or not, so it now requires an explicit conversion to make this requirement visible. + +* Explicit conversion into ``address`` type always returns a non-payable ``address`` type. In + particular, the following explicit conversions have the type ``address`` instead of ``address + payable``: + + - ``address(u)`` where ``u`` is a variable of type ``uint160``. One can convert ``u`` + into the type ``address payable`` by using two explicit conversions, i.e., + ``payable(address(u))``. + - ``address(b)`` where ``b`` is a variable of type ``bytes20``. One can convert ``b`` + into the type ``address payable`` by using two explicit conversions, i.e., + ``payable(address(b))``. + - ``address(c)`` where ``c`` is a contract. Previously, the return type of this + conversion depended on whether the contract can receive Ether (either by having a receive + function or a payable fallback function). The conversion ``payable(c)`` has the type ``address + payable`` and is only allowed when the contract ``c`` can receive Ether. In general, one can + always convert ``c`` into the type ``address payable`` by using the following explicit + conversion: ``payable(address(c))``. Note that ``address(this)`` falls under the same category + as ``address(c)`` and the same rules apply for it. + +* The ``chainid`` builtin in inline assembly is now considered ``view`` instead of ``pure``. + +* Unary negation cannot be used on unsigned integers anymore, only on signed integers. + +Interface Changes +================= + +* The output of ``--combined-json`` has changed: JSON fields ``abi``, ``devdoc``, ``userdoc`` and + ``storage-layout`` are sub-objects now. Before 0.8.0 they used to be serialised as strings. + +* The "legacy AST" has been removed (``--ast-json`` on the commandline interface and ``legacyAST`` for standard JSON). + Use the "compact AST" (``--ast-compact--json`` resp. ``AST``) as replacement. + +* The old error reporter (``--old-reporter``) has been removed. + + +How to update your code +======================= + +- If you rely on wrapping arithmetic, surround each operation with ``unchecked { ... }``. +- Optional: If you use SafeMath or a similar library, change ``x.add(y)`` to ``x + y``, ``x.mul(y)`` to ``x * y`` etc. +- Add ``pragma abicoder v1;`` if you want to stay with the old ABI coder. +- Optionally remove ``pragma experimental ABIEncoderV2`` or ``pragma abicoder v2`` since it is redundant. +- Change ``byte`` to ``bytes1``. +- Add intermediate explicit type conversions if required. +- Combine ``c.f{gas: 10000}{value: 1}()`` to ``c.f{gas: 10000, value: 1}()``. +- 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) diff --git a/compiler/docs/_static/css/custom.css b/compiler/docs/_static/css/custom.css index fd506203..4ff53f3a 100644 --- a/compiler/docs/_static/css/custom.css +++ b/compiler/docs/_static/css/custom.css @@ -1,14 +1,86 @@ 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; + 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; } .wy-table-responsive table td, .wy-table-responsive table th { - white-space: normal; + white-space: normal; } .rst-content table.docutils td { - vertical-align: top; + vertical-align: top; +} + +/* links */ +.rst-content a:not(:visited) { + color: #002fa7; +} + +.rst-content .highlighted { + background: #eac545; +} + +/* code block highlights */ +.rst-content 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; +} + +/* 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; + display: block; + width: 1.5em; + height: 1.5em; + margin: auto; +} + +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; +} + +a.remix-link:hover { + opacity: 0.5; +} + +a.remix-link:hover .link-text { + display: block; } diff --git a/compiler/docs/_static/css/dark.css b/compiler/docs/_static/css/dark.css new file mode 100644 index 00000000..a87ff09e --- /dev/null +++ b/compiler/docs/_static/css/dark.css @@ -0,0 +1,635 @@ +/* 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. */ +} diff --git a/compiler/docs/_static/css/toggle.css b/compiler/docs/_static/css/toggle.css new file mode 100644 index 00000000..add134f6 --- /dev/null +++ b/compiler/docs/_static/css/toggle.css @@ -0,0 +1,83 @@ +input[type=checkbox] { + visibility: hidden; + height: 0; + width: 0; + margin: 0; +} + +.rst-versions .rst-current-version { + padding: 10px; + display: flex; + justify-content: space-between; +} + +.rst-versions .rst-current-version .fa-book, +.rst-versions .rst-current-version .fa-v, +.rst-versions .rst-current-version .fa-caret-down { + height: 24px; + line-height: 24px; + vertical-align: middle; +} + +.rst-versions .rst-current-version .fa-element { + width: 80px; + text-align: center; +} + +.rst-versions .rst-current-version .fa-book { + text-align: left; +} + +.rst-versions .rst-current-version .fa-v { + color: #27AE60; + text-align: right; +} + +label { + margin: 0 auto; + display: inline-block; + justify-content: center; + align-items: right; + border-radius: 100px; + position: relative; + cursor: pointer; + text-indent: -9999px; + width: 50px; + height: 21px; + background: #000; +} + +label:after { + border-radius: 50%; + position: absolute; + content: ''; + background: #fff; + width: 15px; + height: 15px; + top: 3px; + left: 3px; + transition: ease-in-out 200ms; +} + +input:checked+label { + background: #3a7ca8; +} + +input:checked+label:after { + left: calc(100% - 5px); + transform: translateX(-100%); +} + +html.transition, +html.transition *, +html.transition *:before, +html.transition *:after { + transition: ease-in-out 200ms !important; + 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; +} diff --git a/compiler/docs/_static/img/solid-share-arrow.svg b/compiler/docs/_static/img/solid-share-arrow.svg new file mode 100644 index 00000000..1a1e6100 --- /dev/null +++ b/compiler/docs/_static/img/solid-share-arrow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/compiler/docs/_static/js/toggle.js b/compiler/docs/_static/js/toggle.js new file mode 100644 index 00000000..780ea9ee --- /dev/null +++ b/compiler/docs/_static/js/toggle.js @@ -0,0 +1,39 @@ +document.addEventListener('DOMContentLoaded', function() { + + function toggleCssMode(isDay) { + var mode = (isDay ? "Day" : "Night"); + localStorage.setItem("css-mode", mode); + + var url_root = DOCUMENTATION_OPTIONS.URL_ROOT == "./" ? "" : DOCUMENTATION_OPTIONS.URL_ROOT; + var daysheet = $(`link[href="${url_root}_static/pygments.css"]`)[0].sheet; + daysheet.disabled = !isDay; + + var nightsheet = $(`link[href="${url_root}_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", `${url_root}_static/css/dark.css`); + document.getElementsByTagName("head")[0].appendChild(element); + return; + } + if (nightsheet !== undefined) { + nightsheet.sheet.disabled = isDay; + } + } + + 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); + }) + +}); \ No newline at end of file diff --git a/compiler/docs/_templates/footer.html b/compiler/docs/_templates/footer.html new file mode 100644 index 00000000..59c7d758 --- /dev/null +++ b/compiler/docs/_templates/footer.html @@ -0,0 +1,7 @@ +{% extends "!footer.html" %} + +{% block extrafooter %} +

+ Credits and attribution. +

+{% endblock %} diff --git a/compiler/docs/_templates/layout.html b/compiler/docs/_templates/layout.html index 1db4ef92..498c0e6e 100644 --- a/compiler/docs/_templates/layout.html +++ b/compiler/docs/_templates/layout.html @@ -1,6 +1,10 @@ {% extends "!layout.html" %} - {% block menu %} +{% block menu %} {{ super() }} - Keyword Index - {% endblock %} + +{% endblock %} diff --git a/compiler/docs/_templates/versions.html b/compiler/docs/_templates/versions.html new file mode 100644 index 00000000..a2432e37 --- /dev/null +++ b/compiler/docs/_templates/versions.html @@ -0,0 +1,36 @@ +{# Add rst-badge after rst-versions for small badge style. #} +
+ + RTD + + + + + + + v: {{ current_version }} + + +
+
+
{{ _('Downloads') }}
{% for type, url in downloads %} +
{{ type }}
+ {% endfor %} +
+
+
{{ _('Versions') }}
{% for slug, url in versions %} +
{{ slug }}
+ {% endfor %} +
+
+ {# Translators: The phrase "Read the Docs" is not translated #} +
{{ _('On Read the Docs') }}
+
+ {{ _('Project Home') }} +
+
+ {{ _('Builds') }} +
+
+
+
diff --git a/compiler/docs/abi-spec.rst b/compiler/docs/abi-spec.rst index a3bd7831..9164ae6a 100644 --- a/compiler/docs/abi-spec.rst +++ b/compiler/docs/abi-spec.rst @@ -13,22 +13,23 @@ 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; of a function Function Selector ================= The first four bytes of the call data for a function call specifies the function to be called. It is the -first (left, high-order in big-endian) four bytes of the Keccak-256 (SHA-3) hash of the signature of +first (left, high-order in big-endian) four bytes of the Keccak-256 hash of the signature of 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 @@ -61,7 +62,7 @@ The following elementary types exist: - ``bool``: equivalent to ``uint8`` restricted to the values 0 and 1. For computing the function selector, ``bool`` is used. - ``fixedx``: signed fixed-point decimal number of ``M`` bits, ``8 <= M <= 256``, - ``M % 8 ==0``, and ``0 < N <= 80``, which denotes the value ``v`` as ``v / (10 ** N)``. + ``M % 8 == 0``, and ``0 < N <= 80``, which denotes the value ``v`` as ``v / (10 ** N)``. - ``ufixedx``: unsigned variant of ``fixedx``. @@ -76,6 +77,10 @@ The following (fixed-size) array type exists: - ``[M]``: a fixed-length array of ``M`` elements, ``M >= 0``, of the given type. + .. note:: + + While this ABI specification can express fixed-length arrays with zero elements, they're not supported by the compiler. + The following non-fixed-size types exist: - ``bytes``: dynamic sized byte sequence. @@ -106,26 +111,30 @@ them. +-------------------------------+-----------------------------------------------------------------------------+ |:ref:`contract` |``address`` | +-------------------------------+-----------------------------------------------------------------------------+ -|:ref:`enum` |smallest ``uint`` type that is large enough to hold all values | -| | | -| |For example, an ``enum`` of 255 values or less is mapped to ``uint8`` and | -| |an ``enum`` of 256 values is mapped to ``uint16``. | +|:ref:`enum` |``uint8`` | ++-------------------------------+-----------------------------------------------------------------------------+ +|:ref:`user defined value types |its underlying value type | +|` | | +-------------------------------+-----------------------------------------------------------------------------+ |:ref:`struct` |``tuple`` | +-------------------------------+-----------------------------------------------------------------------------+ +.. warning:: + Before version ``0.8.0`` enums could have more than 256 members and were represented by the + smallest integer type just big enough to hold the value of any member. + Design Criteria for the Encoding ================================ The encoding is designed to have the following properties, which are especially useful if some arguments are nested arrays: - 1. The number of reads necessary to access a value is at most the depth of the value - inside the argument array structure, i.e. four reads are needed to retrieve ``a_i[k][l][r]``. In a - previous version of the ABI, the number of reads scaled linearly with the total number of dynamic - parameters in the worst case. +1. The number of reads necessary to access a value is at most the depth of the value + inside the argument array structure, i.e. four reads are needed to retrieve ``a_i[k][l][r]``. In a + 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 - relocatable, i.e. it only uses relative "addresses". +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". Formal Specification of the Encoding @@ -195,14 +204,14 @@ on the type of ``X`` being - ``string``: - ``enc(X) = enc(enc_utf8(X))``, i.e. ``X`` is utf-8 encoded and this value is interpreted + ``enc(X) = enc(enc_utf8(X))``, i.e. ``X`` is UTF-8 encoded and this value is interpreted as of ``bytes`` type and encoded further. Note that the length used in this subsequent - encoding is the number of bytes of the utf-8 encoded string, not its number of characters. + encoding is the number of bytes of the UTF-8 encoded string, not its number of characters. - ``uint``: ``enc(X)`` is the big-endian encoding of ``X``, padded on the higher-order (left) side with zero-bytes such that the length is 32 bytes. - ``address``: as in the ``uint160`` case -- ``int``: ``enc(X)`` is the big-endian two's complement encoding of ``X``, padded on the higher-order (left) side with ``0xff`` for negative ``X`` and with zero bytes for positive ``X`` such that the length is 32 bytes. +- ``int``: ``enc(X)`` is the big-endian two's complement encoding of ``X``, padded on the higher-order (left) side with ``0xff`` bytes for negative ``X`` and with zero-bytes for non-negative ``X`` such that the length is 32 bytes. - ``bool``: as in the ``uint8`` case, where ``1`` is used for ``true`` and ``0`` for ``false`` - ``fixedx``: ``enc(X)`` is ``enc(X * 10**N)`` where ``X * 10**N`` is interpreted as a ``int256``. - ``fixed``: as in the ``fixed128x18`` case @@ -230,10 +239,11 @@ Examples Given the contract: -:: - - pragma solidity >=0.4.16 <0.7.0; +.. code-block:: solidity + :force: + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.16 <0.9.0; contract Foo { function bar(bytes3[2] memory) public pure {} @@ -242,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 @@ -298,7 +308,7 @@ 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``. @@ -307,21 +317,21 @@ these are directly the values we want to pass, whereas for the dynamic types ``u we use the offset in bytes to the start of their data area, measured from the start of the value encoding (i.e. not counting the first four bytes containing the hash of the function signature). These are: - - ``0x0000000000000000000000000000000000000000000000000000000000000123`` (``0x123`` padded to 32 bytes) - - ``0x0000000000000000000000000000000000000000000000000000000000000080`` (offset to start of data part of second parameter, 4*32 bytes, exactly the size of the head part) - - ``0x3132333435363738393000000000000000000000000000000000000000000000`` (``"1234567890"`` padded to 32 bytes on the right) - - ``0x00000000000000000000000000000000000000000000000000000000000000e0`` (offset to start of data part of fourth parameter = offset to start of data part of first dynamic parameter + size of data part of first dynamic parameter = 4\*32 + 3\*32 (see below)) +- ``0x0000000000000000000000000000000000000000000000000000000000000123`` (``0x123`` padded to 32 bytes) +- ``0x0000000000000000000000000000000000000000000000000000000000000080`` (offset to start of data part of second parameter, 4*32 bytes, exactly the size of the head part) +- ``0x3132333435363738393000000000000000000000000000000000000000000000`` (``"1234567890"`` padded to 32 bytes on the right) +- ``0x00000000000000000000000000000000000000000000000000000000000000e0`` (offset to start of data part of fourth parameter = offset to start of data part of first dynamic parameter + size of data part of first dynamic parameter = 4\*32 + 3\*32 (see below)) After this, the data part of the first dynamic argument, ``[0x456, 0x789]`` follows: - - ``0x0000000000000000000000000000000000000000000000000000000000000002`` (number of elements of the array, 2) - - ``0x0000000000000000000000000000000000000000000000000000000000000456`` (first element) - - ``0x0000000000000000000000000000000000000000000000000000000000000789`` (second element) +- ``0x0000000000000000000000000000000000000000000000000000000000000002`` (number of elements of the array, 2) +- ``0x0000000000000000000000000000000000000000000000000000000000000456`` (first element) +- ``0x0000000000000000000000000000000000000000000000000000000000000789`` (second element) Finally, we encode the data part of the second dynamic argument, ``"Hello, world!"``: - - ``0x000000000000000000000000000000000000000000000000000000000000000d`` (number of elements (bytes in this case): 13) - - ``0x48656c6c6f2c20776f726c642100000000000000000000000000000000000000`` (``"Hello, world!"`` padded to 32 bytes on the right) +- ``0x000000000000000000000000000000000000000000000000000000000000000d`` (number of elements (bytes in this case): 13) +- ``0x48656c6c6f2c20776f726c642100000000000000000000000000000000000000`` (``"Hello, world!"`` padded to 32 bytes on the right) All together, the encoding is (newline after function selector and each 32-bytes for clarity): @@ -338,19 +348,19 @@ 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]]``: - - ``0x0000000000000000000000000000000000000000000000000000000000000002`` (number of elements in the first array, 2; the elements themselves are ``1`` and ``2``) - - ``0x0000000000000000000000000000000000000000000000000000000000000001`` (first element) - - ``0x0000000000000000000000000000000000000000000000000000000000000002`` (second element) +- ``0x0000000000000000000000000000000000000000000000000000000000000002`` (number of elements in the first array, 2; the elements themselves are ``1`` and ``2``) +- ``0x0000000000000000000000000000000000000000000000000000000000000001`` (first element) +- ``0x0000000000000000000000000000000000000000000000000000000000000002`` (second element) Then we encode the length and data of the second embedded dynamic array ``[3]`` of the first root array ``[[1, 2], [3]]``: - - ``0x0000000000000000000000000000000000000000000000000000000000000001`` (number of elements in the second array, 1; the element is ``3``) - - ``0x0000000000000000000000000000000000000000000000000000000000000003`` (first element) +- ``0x0000000000000000000000000000000000000000000000000000000000000001`` (number of elements in the second array, 1; the element is ``3``) +- ``0x0000000000000000000000000000000000000000000000000000000000000003`` (first element) Then we need to find the offsets ``a`` and ``b`` for their respective dynamic arrays ``[1, 2]`` and ``[3]``. To calculate the offsets we can take a look at the encoded data of the first root array ``[[1, 2], [3]]`` @@ -375,12 +385,12 @@ thus ``b = 0x00000000000000000000000000000000000000000000000000000000000000a0``. Then we encode the embedded strings of the second root array: - - ``0x0000000000000000000000000000000000000000000000000000000000000003`` (number of characters in word ``"one"``) - - ``0x6f6e650000000000000000000000000000000000000000000000000000000000`` (utf8 representation of word ``"one"``) - - ``0x0000000000000000000000000000000000000000000000000000000000000003`` (number of characters in word ``"two"``) - - ``0x74776f0000000000000000000000000000000000000000000000000000000000`` (utf8 representation of word ``"two"``) - - ``0x0000000000000000000000000000000000000000000000000000000000000005`` (number of characters in word ``"three"``) - - ``0x7468726565000000000000000000000000000000000000000000000000000000`` (utf8 representation of word ``"three"``) +- ``0x0000000000000000000000000000000000000000000000000000000000000003`` (number of characters in word ``"one"``) +- ``0x6f6e650000000000000000000000000000000000000000000000000000000000`` (utf8 representation of word ``"one"``) +- ``0x0000000000000000000000000000000000000000000000000000000000000003`` (number of characters in word ``"two"``) +- ``0x74776f0000000000000000000000000000000000000000000000000000000000`` (utf8 representation of word ``"two"``) +- ``0x0000000000000000000000000000000000000000000000000000000000000005`` (number of characters in word ``"three"``) +- ``0x7468726565000000000000000000000000000000000000000000000000000000`` (utf8 representation of word ``"three"``) In parallel to the first root array, since strings are dynamic elements we need to find their offsets ``c``, ``d`` and ``e``: @@ -407,15 +417,15 @@ 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: - - ``0x0000000000000000000000000000000000000000000000000000000000000002`` (number of elements in the first root array, 2; the elements themselves are ``[1, 2]`` and ``[3]``) +- ``0x0000000000000000000000000000000000000000000000000000000000000002`` (number of elements in the first root array, 2; the elements themselves are ``[1, 2]`` and ``[3]``) Then we encode the length of the second root array: - - ``0x0000000000000000000000000000000000000000000000000000000000000003`` (number of strings in the second root array, 3; the strings themselves are ``"one"``, ``"two"`` and ``"three"``) +- ``0x0000000000000000000000000000000000000000000000000000000000000003`` (number of strings in the second root array, 3; the strings themselves are ``"one"``, ``"two"`` and ``"three"``) Finally we find the offsets ``f`` and ``g`` for their respective root dynamic arrays ``[[1, 2], [3]]`` and ``["one", "two", "three"]``, and assemble parts in the correct order: @@ -460,17 +470,20 @@ address, a series of up to four topics and some arbitrary length binary data. Ev ABI in order to interpret this (together with an interface spec) as a properly typed structure. Given an event name and series of event parameters, we split them into two sub-series: those which are indexed and -those which are not. Those which are indexed, which may number up to 3, are used alongside the Keccak hash of the -event signature to form the topics of the log entry. Those which are not indexed form the byte array of the event. +those which are not. +Those which are indexed, which may number up to 3 (for non-anonymous events) or 4 (for anonymous ones), are used +alongside the Keccak hash of the event signature to form the topics of the log entry. +Those which are not indexed form the byte array of the event. In effect, a log entry using this ABI is described as: - ``address``: the address of the contract (intrinsically provided by Ethereum); - ``topics[0]``: ``keccak(EVENT_NAME+"("+EVENT_ARGS.map(canonical_type_of).join(",")+")")`` (``canonical_type_of`` is a function that simply returns the canonical type of a given argument, e.g. for ``uint indexed foo``, it would - return ``uint256``). If the event is declared as ``anonymous`` the ``topics[0]`` is not generated; -- ``topics[n]``: ``abi_encode(EVENT_INDEXED_ARGS[n - 1])`` (``EVENT_INDEXED_ARGS`` is the series of ``EVENT_ARGS`` - that are indexed); + return ``uint256``). This value is only present in ``topics[0]`` if the event is not declared as ``anonymous``; +- ``topics[n]``: ``abi_encode(EVENT_INDEXED_ARGS[n - 1])`` if the event is not declared as ``anonymous`` + or ``abi_encode(EVENT_INDEXED_ARGS[n])`` if it is (``EVENT_INDEXED_ARGS`` is the series of ``EVENT_ARGS`` that + are indexed); - ``data``: ABI encoding of ``EVENT_NON_INDEXED_ARGS`` (``EVENT_NON_INDEXED_ARGS`` is the series of ``EVENT_ARGS`` that are not indexed, ``abi_encode`` is the ABI encoding function used for returning a series of typed values from a function, as described above). @@ -489,12 +502,52 @@ the arguments not be indexed). Developers may overcome this tradeoff and achieve efficient search and arbitrary legibility by defining events with two arguments — one indexed, one not — intended to hold the same value. +.. _abi_errors: +.. index:: error, selector; of an error + +Errors +====== + +In case of a failure inside a contract, the contract can use a special opcode to abort execution and revert +all state changes. In addition to these effects, descriptive data can be returned to the caller. +This descriptive data is the encoding of an error and its arguments in the same way as data for a function +call. + +As an example, let us consider the following contract whose ``transfer`` function always +reverts with a custom error of "insufficient balance": + +.. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.4; + + contract TestToken { + error InsufficientBalance(uint256 available, uint256 required); + function transfer(address /*to*/, uint amount) public pure { + revert InsufficientBalance(0, amount); + } + } + +The return data would be encoded in the same way as the function call +``InsufficientBalance(0, amount)`` to the function ``InsufficientBalance(uint256,uint256)``, +i.e. ``0xcf479181``, ``uint256(0)``, ``uint256(amount)``. + +The error selectors ``0x00000000`` and ``0xffffffff`` are reserved for future use. + +.. warning:: + Never trust error data. + The error data by default bubbles up through the chain of external calls, which + means that a contract may receive an error not defined in any of the contracts + it calls directly. + Furthermore, any contract can fake any error by returning data that matches + an error signature, even if the error is not defined anywhere. + .. _abi_json: JSON ==== -The JSON format for a contract's interface is given by an array of function and/or event descriptions. +The JSON format for a contract's interface is given by an array of function, event and error descriptions. A function description is a JSON object with the fields: - ``type``: ``"function"``, ``"constructor"``, ``"receive"`` (the :ref:`"receive Ether" function `) or ``"fallback"`` (the :ref:`"default" function `); @@ -508,13 +561,17 @@ A function description is a JSON object with the fields: - ``outputs``: an array of objects similar to ``inputs``. - ``stateMutability``: a string with one of the following values: ``pure`` (:ref:`specified to not read blockchain state `), ``view`` (:ref:`specified to not modify the blockchain - state `), ``nonpayable`` (function does not accept Ether) and ``payable`` (function accepts Ether). + state `), ``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. .. note:: Sending non-zero Ether to non-payable function will revert the transaction. +.. note:: + The state mutability ``nonpayable`` is reflected in Solidity by not specifying + a state mutability modifier at all. + An event description is a JSON object with fairly similar fields: - ``type``: always ``"event"`` @@ -528,17 +585,37 @@ An event description is a JSON object with fairly similar fields: - ``anonymous``: ``true`` if the event was declared as ``anonymous``. +Errors look as follows: + +- ``type``: always ``"error"`` +- ``name``: the name of the error. +- ``inputs``: an array of objects, each of which contains: + + * ``name``: the name of the parameter. + * ``type``: the canonical type of the parameter (more below). + * ``components``: used for tuple types (more below). + +.. 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 + 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. + + For example, -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.4; contract Test { - constructor() public { b = hex"12345678901234567890123456789012"; } + constructor() { b = hex"12345678901234567890123456789012"; } event Event(uint indexed a, bytes32 b); event Event2(uint indexed a, bytes32 b); + error InsufficientBalance(uint256 available, uint256 required); function foo(uint a) public { emit Event(a, b); } bytes32 b; } @@ -547,25 +624,29 @@ would result in the JSON: .. code-block:: json - [{ - "type":"event", - "inputs": [{"name":"a","type":"uint256","indexed":true},{"name":"b","type":"bytes32","indexed":false}], - "name":"Event" - }, { - "type":"event", - "inputs": [{"name":"a","type":"uint256","indexed":true},{"name":"b","type":"bytes32","indexed":false}], - "name":"Event2" - }, { - "type":"function", - "inputs": [{"name":"a","type":"uint256"}], - "name":"foo", - "outputs": [] - }] + [{ + "type":"error", + "inputs": [{"name":"available","type":"uint256"},{"name":"required","type":"uint256"}], + "name":"InsufficientBalance" + }, { + "type":"event", + "inputs": [{"name":"a","type":"uint256","indexed":true},{"name":"b","type":"bytes32","indexed":false}], + "name":"Event" + }, { + "type":"event", + "inputs": [{"name":"a","type":"uint256","indexed":true},{"name":"b","type":"bytes32","indexed":false}], + "name":"Event2" + }, { + "type":"function", + "inputs": [{"name":"a","type":"uint256"}], + "name":"foo", + "outputs": [] + }] 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. @@ -573,83 +654,83 @@ 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 -:: - - pragma solidity >=0.4.19 <0.7.0; - pragma experimental ABIEncoderV2; +.. code-block:: solidity + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.5 <0.9.0; + pragma abicoder v2; contract Test { struct S { uint a; uint[] b; T[] c; } struct T { uint x; uint y; } - function f(S memory s, T memory t, uint a) public {} - function g() public returns (S memory s, T memory t, uint a) {} + function f(S memory, T memory, uint) public pure {} + function g() public pure returns (S memory, T memory, uint) {} } would result in the JSON: .. code-block:: json - [ - { - "name": "f", - "type": "function", - "inputs": [ - { - "name": "s", - "type": "tuple", - "components": [ - { - "name": "a", - "type": "uint256" - }, - { - "name": "b", - "type": "uint256[]" - }, - { - "name": "c", - "type": "tuple[]", - "components": [ - { - "name": "x", - "type": "uint256" - }, - { - "name": "y", - "type": "uint256" - } - ] - } - ] - }, - { - "name": "t", - "type": "tuple", - "components": [ - { - "name": "x", - "type": "uint256" - }, - { - "name": "y", - "type": "uint256" - } - ] - }, - { - "name": "a", - "type": "uint256" - } - ], - "outputs": [] - } - ] + [ + { + "name": "f", + "type": "function", + "inputs": [ + { + "name": "s", + "type": "tuple", + "components": [ + { + "name": "a", + "type": "uint256" + }, + { + "name": "b", + "type": "uint256[]" + }, + { + "name": "c", + "type": "tuple[]", + "components": [ + { + "name": "x", + "type": "uint256" + }, + { + "name": "y", + "type": "uint256" + } + ] + } + ] + }, + { + "name": "t", + "type": "tuple", + "components": [ + { + "name": "x", + "type": "uint256" + }, + { + "name": "y", + "type": "uint256" + } + ] + }, + { + "name": "a", + "type": "uint256" + } + ], + "outputs": [] + } + ] .. _abi_packed_mode: @@ -657,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. @@ -669,7 +750,7 @@ Non-standard Packed Mode Through ``abi.encodePacked()``, Solidity supports a non-standard packed mode where: -- types shorter than 32 bytes are neither zero padded nor sign extended and +- types shorter than 32 bytes are concatenated directly, without padding or sign extension - dynamic types are encoded in-place and without the length. - array elements are padded, but still encoded in-place @@ -686,18 +767,19 @@ As an example, the encoding of ``int16(-1), bytes1(0x42), uint16(0x03), string(" ^^^^^^^^^^^^^^^^^^^^^^^^^^ string("Hello, world!") without a length field More specifically: - - During the encoding, everything is encoded in-place. This means that there is - no distinction between head and tail, as in the ABI encoding, and the length - of an array is not encoded. - - The direct arguments of ``abi.encodePacked`` are encoded without padding, - as long as they are not arrays (or ``string`` or ``bytes``). - - The encoding of an array is the concatenation of the - 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 - unless it is part of an array or struct (then it is padded to a multiple of - 32 bytes). + +- During the encoding, everything is encoded in-place. This means that there is + no distinction between head and tail, as in the ABI encoding, and the length + of an array is not encoded. +- The direct arguments of ``abi.encodePacked`` are encoded without padding, + as long as they are not arrays (or ``string`` or ``bytes``). +- The encoding of an array is the concatenation of the + 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, + unless it is part of an array or struct (then it is padded to a multiple of + 32 bytes). In general, the encoding is ambiguous as soon as there are two dynamically-sized elements, because of the missing length field. @@ -709,12 +791,12 @@ for prepending a function selector. Since the encoding is ambiguous, there is no .. warning:: - If you use ``keccak256(abi.encodePacked(a, b))`` and both ``a`` and ``b`` are dynamic types, - it is easy to craft collisions in the hash value by moving parts of ``a`` into ``b`` and - vice-versa. More specifically, ``abi.encodePacked("a", "bc") == abi.encodePacked("ab", "c")``. - If you use ``abi.encodePacked`` for signatures, authentication or data integrity, make - sure to always use the same types and check that at most one of them is dynamic. - Unless there is a compelling reason, ``abi.encode`` should be preferred. + If you use ``keccak256(abi.encodePacked(a, b))`` and both ``a`` and ``b`` are dynamic types, + it is easy to craft collisions in the hash value by moving parts of ``a`` into ``b`` and + vice-versa. More specifically, ``abi.encodePacked("a", "bc") == abi.encodePacked("ab", "c")``. + If you use ``abi.encodePacked`` for signatures, authentication or data integrity, make + sure to always use the same types and check that at most one of them is dynamic. + Unless there is a compelling reason, ``abi.encode`` should be preferred. .. _indexed_event_encoding: @@ -723,16 +805,16 @@ 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 - without any padding or length prefix. - - the encoding of a struct is the concatenation of the encoding of its members, - always padded to a multiple of 32 bytes (even ``bytes`` and ``string``). - - the encoding of an array (both dynamically- and statically-sized) is - the concatenation of the encoding of its elements, always padded to a multiple - of 32 bytes (even ``bytes`` and ``string``) and without any length prefix +- the encoding of a ``bytes`` and ``string`` value is just the string contents + without any padding or length prefix. +- the encoding of a struct is the concatenation of the encoding of its members, + always padded to a multiple of 32 bytes (even ``bytes`` and ``string``). +- the encoding of an array (both dynamically- and statically-sized) is + the concatenation of the encoding of its elements, always padded to a multiple + of 32 bytes (even ``bytes`` and ``string``) and without any length prefix In the above, as usual, a negative number is padded by sign extension and not zero padded. ``bytesNN`` types are padded on the right while ``uintNN`` / ``intNN`` are padded on the left. diff --git a/compiler/docs/analysing-compilation-output.rst b/compiler/docs/analysing-compilation-output.rst new file mode 100644 index 00000000..892b18b9 --- /dev/null +++ b/compiler/docs/analysing-compilation-output.rst @@ -0,0 +1,192 @@ +.. index:: analyse, asm + +############################# +Analysing the Compiler Output +############################# + +It is often useful to look at the assembly code generated by the compiler. The generated binary, +i.e., the output of ``solc --bin contract.sol``, is generally difficult to read. It is recommended +to use the flag ``--asm`` to analyse the assembly output. Even for large contracts, looking at a +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 + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.5.0 <0.9.0; + contract C { + function one() public pure returns (uint) { + return 1; + } + } + +The following would be the output of ``solc --asm contract.sol`` + +.. code-block:: none + + ======= contract.sol:C ======= + EVM assembly: + /* "contract.sol":0:86 contract C {... */ + mstore(0x40, 0x80) + callvalue + dup1 + iszero + tag_1 + jumpi + 0x00 + dup1 + revert + tag_1: + pop + dataSize(sub_0) + dup1 + dataOffset(sub_0) + 0x00 + codecopy + 0x00 + return + stop + + sub_0: assembly { + /* "contract.sol":0:86 contract C {... */ + mstore(0x40, 0x80) + callvalue + dup1 + iszero + tag_1 + jumpi + 0x00 + dup1 + revert + tag_1: + pop + jumpi(tag_2, lt(calldatasize, 0x04)) + shr(0xe0, calldataload(0x00)) + dup1 + 0x901717d1 + eq + tag_3 + jumpi + tag_2: + 0x00 + dup1 + revert + /* "contract.sol":17:84 function one() public pure returns (uint) {... */ + tag_3: + tag_4 + tag_5 + jump // in + tag_4: + mload(0x40) + tag_6 + swap2 + swap1 + tag_7 + jump // in + tag_6: + mload(0x40) + dup1 + swap2 + sub + swap1 + return + tag_5: + /* "contract.sol":53:57 uint */ + 0x00 + /* "contract.sol":76:77 1 */ + 0x01 + /* "contract.sol":69:77 return 1 */ + swap1 + pop + /* "contract.sol":17:84 function one() public pure returns (uint) {... */ + swap1 + jump // out + /* "#utility.yul":7:125 */ + tag_10: + /* "#utility.yul":94:118 */ + tag_12 + /* "#utility.yul":112:117 */ + dup2 + /* "#utility.yul":94:118 */ + tag_13 + jump // in + tag_12: + /* "#utility.yul":89:92 */ + dup3 + /* "#utility.yul":82:119 */ + mstore + /* "#utility.yul":72:125 */ + pop + pop + jump // out + /* "#utility.yul":131:353 */ + tag_7: + 0x00 + /* "#utility.yul":262:264 */ + 0x20 + /* "#utility.yul":251:260 */ + dup3 + /* "#utility.yul":247:265 */ + add + /* "#utility.yul":239:265 */ + swap1 + pop + /* "#utility.yul":275:346 */ + tag_15 + /* "#utility.yul":343:344 */ + 0x00 + /* "#utility.yul":332:341 */ + dup4 + /* "#utility.yul":328:345 */ + add + /* "#utility.yul":319:325 */ + dup5 + /* "#utility.yul":275:346 */ + tag_10 + jump // in + tag_15: + /* "#utility.yul":229:353 */ + swap3 + swap2 + pop + pop + jump // out + /* "#utility.yul":359:436 */ + tag_13: + 0x00 + /* "#utility.yul":425:430 */ + dup2 + /* "#utility.yul":414:430 */ + swap1 + pop + /* "#utility.yul":404:436 */ + swap2 + swap1 + pop + jump // out + + auxdata: 0xa2646970667358221220a5874f19737ddd4c5d77ace1619e5160c67b3d4bedac75fce908fed32d98899864736f6c637827302e382e342d646576656c6f702e323032312e332e33302b636f6d6d69742e65613065363933380058 + } + +Alternatively, the above output can also be obtained from `Remix `_, +under the option "Compilation Details" after compiling a contract. + +Notice that the ``asm`` output starts with the creation / constructor code. The deploy code is +provided as part of the sub object (in the above example, it is part of the sub-object ``sub_0``). +The ``auxdata`` field corresponds to the contract :ref:`metadata +`. The comments in the assembly output point to the +source location. Note that ``#utility.yul`` is an internally generated file of utility functions +that can be obtained using the flags ``--combined-json +generated-sources,generated-sources-runtime``. + +Similarly, the optimized assembly can be obtained with the command: ``solc --optimize --asm +contract.sol``. Often times, it is interesting to see if two different sources in Solidity result in +the same optimized code. For example, to see if the expressions ``(a * b) / c``, ``a * b / c`` +generates the same bytecode. This can be easily done by taking a ``diff`` of the corresponding +assembly output, after potentially stripping comments that reference the source locations. + +.. note:: + + The ``--asm`` output is not designed to be machine readable. Therefore, there may be breaking + changes on the output between minor versions of solc. diff --git a/compiler/docs/assembly.rst b/compiler/docs/assembly.rst index 67c1ab6f..b527ffba 100644 --- a/compiler/docs/assembly.rst +++ b/compiler/docs/assembly.rst @@ -8,10 +8,10 @@ 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 `Yul `_ +The language used for inline assembly in Solidity is called :ref:`Yul ` and it is documented in its own section. This section will only cover how the inline assembly code can interface with the surrounding Solidity code. @@ -24,7 +24,7 @@ how the inline assembly code can interface with the surrounding Solidity code. An inline assembly block is marked by ``assembly { ... }``, where the code inside -the curly braces is code in the `Yul `_ language. +the curly braces is code in the :ref:`Yul ` language. The inline assembly code can access local Solidity variables as explained below. @@ -35,28 +35,29 @@ Example ------- The following example provides library code to access the code of another contract and -load it into a ``bytes`` variable. This is not possible with "plain Solidity" and the -idea is that reusable assembly libraries can enhance the Solidity language -without a compiler change. +load it into a ``bytes`` variable. This is possible with "plain Solidity" too, by using +``
.code``. But the point here is that reusable assembly libraries can enhance the +Solidity language without a compiler change. -.. code:: +.. code-block:: solidity - pragma solidity >=0.4.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + 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) } } } @@ -64,57 +65,58 @@ without a compiler change. Inline assembly is also beneficial in cases where the optimizer fails to produce efficient code, for example: -.. code:: +.. code-block:: solidity - pragma solidity >=0.4.16 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.16 <0.9.0; 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 ----------------------------------------------------- @@ -122,21 +124,63 @@ Access to External Variables, Functions and Libraries 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. +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 `. + +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 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 can be assigned to. For example: + +.. code-block:: solidity + :force: + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.8.10 <0.9.0; + + contract C { + // Assigns a new selector and address to the return variable @fun + function combineToFunctionPointer(address newAddress, uint newSelector) public pure returns (function() external fun) { + assembly { + fun.selector := newSelector + fun.address := newAddress + } + } + } -Local variables that refer to memory or calldata evaluate to the -address of the variable in memory, resp. calldata, not the value itself. +For dynamic calldata arrays, you can access +their calldata offset (in bytes) and length (number of elements) using ``x.offset`` and ``x.length``. +Both expressions can also be assigned to, but as for the static case, no validation will be performed +to ensure that the resulting data area is within the bounds of ``calldatasize()``. For local storage variables or state variables, a single Yul identifier is not sufficient, since they do not necessarily occupy a single full storage slot. Therefore, their "address" is composed of a slot and a byte-offset inside that slot. To retrieve the slot pointed to by the variable ``x``, you -use ``x_slot``, and to retrieve the byte-offset you use ``x_offset``. +use ``x.slot``, and to retrieve the byte-offset you use ``x.offset``. +Using ``x`` itself will result in an error. + +You can also assign to the ``.slot`` part of a local storage variable pointer. +For these (structs, arrays or mappings), the ``.offset`` part is always zero. +It is not possible to assign to the ``.slot`` or ``.offset`` part of a state variable, +though. Local Solidity variables are available for assignments, for example: -.. code:: +.. code-block:: solidity + :force: - pragma solidity >=0.4.11 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; contract C { uint b; @@ -144,14 +188,14 @@ Local Solidity variables are available for assignments, for example: assembly { // We ignore the storage slot offset, we know it is zero // in this special case. - r := mul(x, sload(b_slot)) + r := mul(x, sload(b.slot)) } } } .. warning:: If you access variables of a type that spans less than 256 bits - (for example ``uint64``, ``address``, ``bytes16`` or ``byte``), + (for example ``uint64``, ``address``, or ``bytes16``), you cannot make any assumptions about bits not part of the encoding of the type. Especially, do not assume them to be zero. To be safe, always clear the data properly before you use it @@ -161,18 +205,13 @@ Local Solidity variables are available for assignments, for example: ``assembly { signextend(, x) }`` -Since Solidity 0.6.0 the name of a inline assembly variable may not end in ``_offset`` or ``_slot`` -and it may not shadow any declaration visible in the scope of the inline assembly block -(including variable, contract and function declarations). Similarly, if the name of a declared -variable contains a dot ``.``, the prefix up to the ``.`` may not conflict with any -declaration visible in the scope of the inline assembly block. - - -Assignments are possible to assembly-local variables and to function-local -variables. Take care that when you assign to variables that point to -memory or storage, you will only change the pointer and not the data. - +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). +Since Solidity 0.7.0, variables and functions declared inside the +inline assembly block may not contain ``.``, but using ``.`` is +valid to access Solidity variables from outside the inline assembly block. Things to Avoid --------------- @@ -184,9 +223,16 @@ functional-style opcodes, counting stack height for variable access and removing stack slots for assembly-local variables when the end of their block is reached. +.. _conventions-in-solidity: + 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 @@ -196,13 +242,20 @@ 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 function allocate(length) -> pos { pos := mload(0x40) @@ -217,12 +270,109 @@ This means that the allocatable memory starts at ``0x80``, which is the initial of the free memory pointer. Elements in memory arrays in Solidity always occupy multiples of 32 bytes (this is -even true for ``byte[]``, but not for ``bytes`` and ``string``). Multi-dimensional memory +even true for ``bytes1[]``, but not for ``bytes`` and ``string``). Multi-dimensional memory arrays are pointers to memory arrays. The length of a dynamic array is stored at the 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 `: +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 behaviour 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 +backwards-compatibility with older compiler versions, prefer using the dialect string. diff --git a/compiler/docs/brand-guide.rst b/compiler/docs/brand-guide.rst new file mode 100644 index 00000000..5601b16a --- /dev/null +++ b/compiler/docs/brand-guide.rst @@ -0,0 +1,86 @@ +#################### +Solidity Brand Guide +#################### + +This brand guide features information on Solidity's brand policy and +logo usage guidelines. + +The Solidity Brand +================== + +The Solidity programming language is an open-source, community project +governed by a core team. The core team is sponsored by the `Ethereum +Foundation `_. + +This document aims to provide information about how to best use the +Solidity brand name and logo. + +We encourage you to read this document carefully before using the +brand name or the logo. Your cooperation is highly appreciated! + +Solidity Brand Name +=================== + +"Solidity" should be used to refer to the Solidity programming language +solely. + +Please do not use "Solidity": + +- To refer to any other programming language. + +- In a way that is misleading or may imply association of unrelated + modules, tools, documentation, or other resources with the Solidity + programming language. + +- In ways that confuse the community as to whether the Solidity + programming language is open-source and free to use. + +Solidity Logo License +===================== + +.. image:: https://i.creativecommons.org/l/by/4.0/88x31.png + :width: 88 + :alt: Creative Commons License + +The Solidity logo is distributed and licensed under a `Creative Commons +Attribution 4.0 International License `_. + +This is the most permissive Creative Commons license and allows reuse +and modifications for any purpose. + +You are free to: + +- **Share** — Copy and redistribute the material in any medium or format. + +- **Adapt** — Remix, transform, and build upon the material for any + purpose, even commercially. + +Under the following terms: + +- **Attribution** — You must give appropriate credit, provide a link to + the license, and indicate if changes were made. You may do so in any + reasonable manner, but not in any way that suggests that the Solidity + core team endorses you or your use. + +When using the Solidity logo, please respect the Solidity logo guidelines. + +Solidity Logo Guidelines +======================== + +.. image:: logo.svg + :width: 256 + +*(Right click on the logo to download it.)* + +Please do not: + +- Change the ratio of the logo (do not stretch it or cut it). + +- Change the colors of the logo, unless it is absolutely necessary. + +Credits +======= + +This document was, in parts, derived from the `Python Software +Foundation Trademark Usage Policy `_ +and the `Rust Media Guide `_. diff --git a/compiler/docs/bugs.json b/compiler/docs/bugs.json index 66f1808a..03dafbe4 100644 --- a/compiler/docs/bugs.json +++ b/compiler/docs/bugs.json @@ -1,5 +1,219 @@ [ { + "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": "NestedCallataArrayAbiReencodingSizeValidation", + "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", + "summary": "User defined value types with underlying type shorter than 32 bytes used incorrect storage layout and wasted storage", + "description": "The compiler did not correctly compute the storage layout of user defined value types based on types that are shorter than 32 bytes. It would always use a full storage slot for these types, even if the underlying type was shorter. This was wasteful and might have problems with tooling or contract upgrades.", + "link": "https://blog.soliditylang.org/2021/09/29/user-defined-value-types-bug/", + "introduced": "0.8.8", + "fixed": "0.8.9", + "severity": "very low" + }, + { + "uid": "SOL-2021-3", + "name": "SignedImmutables", + "summary": "Immutable variables of signed integer type shorter than 256 bits can lead to values with invalid higher order bits if inline assembly is used.", + "description": "When immutable variables of signed integer type shorter than 256 bits are read, their higher order bits were unconditionally set to zero. The correct operation would be to sign-extend the value, i.e. set the higher order bits to one if the sign bit is one. This sign-extension is performed by Solidity just prior to when it matters, i.e. when a value is stored in memory, when it is compared or when a division is performed. Because of that, to our knowledge, the only way to access the value in its unclean state is by reading it through inline assembly.", + "link": "https://blog.soliditylang.org/2021/09/29/signed-immutables-bug/", + "introduced": "0.6.5", + "fixed": "0.8.9", + "severity": "very low" + }, + { + "uid": "SOL-2021-2", + "name": "ABIDecodeTwoDimensionalArrayMemory", + "summary": "If used on memory byte arrays, result of the function ``abi.decode`` can depend on the contents of memory outside of the actual byte array that is decoded.", + "description": "The ABI specification uses pointers to data areas for everything that is dynamically-sized. When decoding data from memory (instead of calldata), the ABI decoder did not properly validate some of these pointers. More specifically, it was possible to use large values for the pointers inside arrays such that computing the offset resulted in an undetected overflow. This could lead to these pointers targeting areas in memory outside of the actual area to be decoded. This way, it was possible for ``abi.decode`` to return different values for the same encoded byte array.", + "link": "https://blog.soliditylang.org/2021/04/21/decoding-from-memory-bug/", + "introduced": "0.4.16", + "fixed": "0.8.4", + "conditions": { + "ABIEncoderV2": true + }, + "severity": "very low" + }, + { + "uid": "SOL-2021-1", + "name": "KeccakCaching", + "summary": "The bytecode optimizer incorrectly re-used previously evaluated Keccak-256 hashes. You are unlikely to be affected if you do not compute Keccak-256 hashes in inline assembly.", + "description": "Solidity's bytecode optimizer has a step that can compute Keccak-256 hashes, if the contents of the memory are known during compilation time. This step also has a mechanism to determine that two Keccak-256 hashes are equal even if the values in memory are not known during compile time. This mechanism had a bug where Keccak-256 of the same memory content, but different sizes were considered equal. More specifically, ``keccak256(mpos1, length1)`` and ``keccak256(mpos2, length2)`` in some cases were considered equal if ``length1`` and ``length2``, when rounded up to nearest multiple of 32 were the same, and when the memory contents at ``mpos1`` and ``mpos2`` can be deduced to be equal. You maybe affected if you compute multiple Keccak-256 hashes of the same content, but with different lengths inside inline assembly. You are unaffected if your code uses ``keccak256`` with a length that is not a compile-time constant or if it is always a multiple of 32.", + "link": "https://blog.soliditylang.org/2021/03/23/keccak-optimizer-bug/", + "fixed": "0.8.3", + "conditions": { + "optimizer": true + }, + "severity": "medium" + }, + { + "uid": "SOL-2020-11", + "name": "EmptyByteArrayCopy", + "summary": "Copying an empty byte array (or string) from memory or calldata to storage can result in data corruption if the target array's length is increased subsequently without storing new data.", + "description": "The routine that copies byte arrays from memory or calldata to storage stores unrelated data from after the source array in the storage slot if the source array is empty. If the storage array's length is subsequently increased either by using ``.push()`` or by assigning to its ``.length`` attribute (only before 0.6.0), the newly created byte array elements will not be zero-initialized, but contain the unrelated data. You are not affected if you do not assign to ``.length`` and do not use ``.push()`` on byte arrays, or only use ``.push()`` or manually initialize the new elements.", + "link": "https://blog.soliditylang.org/2020/10/19/empty-byte-array-copy-bug/", + "fixed": "0.7.4", + "severity": "medium" + }, + { + "uid": "SOL-2020-10", + "name": "DynamicArrayCleanup", + "summary": "When assigning a dynamically-sized array with types of size at most 16 bytes in storage causing the assigned array to shrink, some parts of deleted slots were not zeroed out.", + "description": "Consider a dynamically-sized array in storage whose base-type is small enough such that multiple values can be packed into a single slot, such as `uint128[]`. Let us define its length to be `l`. When this array gets assigned from another array with a smaller length, say `m`, the slots between elements `m` and `l` have to be cleaned by zeroing them out. However, this cleaning was not performed properly. Specifically, after the slot corresponding to `m`, only the first packed value was cleaned up. If this array gets resized to a length larger than `m`, the indices corresponding to the unclean parts of the slot contained the original value, instead of 0. The resizing here is performed by assigning to the array `length`, by a `push()` or via inline assembly. You are not affected if you are only using `.push()` or if you assign a value (even zero) to the new elements after increasing the length of the array.", + "link": "https://blog.soliditylang.org/2020/10/07/solidity-dynamic-array-cleanup-bug/", + "fixed": "0.7.3", + "severity": "medium" + }, + { + "uid": "SOL-2020-9", + "name": "FreeFunctionRedefinition", + "summary": "The compiler does not flag an error when two or more free functions with the same name and parameter types are defined in a source unit or when an imported free function alias shadows another free function with a different name but identical parameter types.", + "description": "In contrast to functions defined inside contracts, free functions with identical names and parameter types did not create an error. Both definition of free functions with identical name and parameter types and an imported free function with an alias that shadows another function with a different name but identical parameter types were permitted due to which a call to either the multiply defined free function or the imported free function alias within a contract led to the execution of that free function which was defined first within the source unit. Subsequently defined identical free function definitions were silently ignored and their code generation was skipped.", + "introduced": "0.7.1", + "fixed": "0.7.2", + "severity": "low" + }, + { + "uid": "SOL-2020-8", + "name": "UsingForCalldata", + "summary": "Function calls to internal library functions with calldata parameters called via ``using for`` can result in invalid data being read.", + "description": "Function calls to internal library functions using the ``using for`` mechanism copied all calldata parameters to memory first and passed them on like that, regardless of whether it was an internal or an external call. Due to that, the called function would receive a memory pointer that is interpreted as a calldata pointer. Since dynamically sized arrays are passed using two stack slots for calldata, but only one for memory, this can lead to stack corruption. An affected library call will consider the JUMPDEST to which it is supposed to return as part of its arguments and will instead jump out to whatever was on the stack before the call.", + "introduced": "0.6.9", + "fixed": "0.6.10", + "severity": "very low" + }, + { + "uid": "SOL-2020-7", + "name": "MissingEscapingInFormatting", + "summary": "String literals containing double backslash characters passed directly to external or encoding function calls can lead to a different string being used when ABIEncoderV2 is enabled.", + "description": "When ABIEncoderV2 is enabled, string literals passed directly to encoding functions or external function calls are stored as strings in the intemediate code. Characters outside the printable range are handled correctly, but backslashes are not escaped in this procedure. This leads to double backslashes being reduced to single backslashes and consequently re-interpreted as escapes potentially resulting in a different string being encoded.", + "introduced": "0.5.14", + "fixed": "0.6.8", + "severity": "very low", + "conditions": { + "ABIEncoderV2": true + } + }, + { + "uid": "SOL-2020-6", + "name": "ArraySliceDynamicallyEncodedBaseType", + "summary": "Accessing array slices of arrays with dynamically encoded base types (e.g. multi-dimensional arrays) can result in invalid data being read.", + "description": "For arrays with dynamically sized base types, index range accesses that use a start expression that is non-zero will result in invalid array slices. Any index access to such array slices will result in data being read from incorrect calldata offsets. Array slices are only supported for dynamic calldata types and all problematic type require ABIEncoderV2 to be enabled.", + "introduced": "0.6.0", + "fixed": "0.6.8", + "severity": "very low", + "conditions": { + "ABIEncoderV2": true + } + }, + { + "uid": "SOL-2020-5", + "name": "ImplicitConstructorCallvalueCheck", + "summary": "The creation code of a contract that does not define a constructor but has a base that does define a constructor did not revert for calls with non-zero value.", + "description": "Starting from Solidity 0.4.5 the creation code of contracts without explicit payable constructor is supposed to contain a callvalue check that results in contract creation reverting, if non-zero value is passed. However, this check was missing in case no explicit constructor was defined in a contract at all, but the contract has a base that does define a constructor. In these cases it is possible to send value in a contract creation transaction or using inline assembly without revert, even though the creation code is supposed to be non-payable.", + "introduced": "0.4.5", + "fixed": "0.6.8", + "severity": "very low" + }, + { + "uid": "SOL-2020-4", + "name": "TupleAssignmentMultiStackSlotComponents", + "summary": "Tuple assignments with components that occupy several stack slots, i.e. nested tuples, pointers to external functions or references to dynamically sized calldata arrays, can result in invalid values.", + "description": "Tuple assignments did not correctly account for tuple components that occupy multiple stack slots in case the number of stack slots differs between left-hand-side and right-hand-side. This can either happen in the presence of nested tuples or if the right-hand-side contains external function pointers or references to dynamic calldata arrays, while the left-hand-side contains an omission.", + "introduced": "0.1.6", + "fixed": "0.6.6", + "severity": "very low" + }, + { + "uid": "SOL-2020-3", + "name": "MemoryArrayCreationOverflow", + "summary": "The creation of very large memory arrays can result in overlapping memory regions and thus memory corruption.", + "description": "No runtime overflow checks were performed for the length of memory arrays during creation. In cases for which the memory size of an array in bytes, i.e. the array length times 32, is larger than 2^256-1, the memory allocation will overflow, potentially resulting in overlapping memory areas. The length of the array is still stored correctly, so copying or iterating over such an array will result in out-of-gas.", + "link": "https://blog.soliditylang.org/2020/04/06/memory-creation-overflow-bug/", + "introduced": "0.2.0", + "fixed": "0.6.5", + "severity": "low" + }, + { + "uid": "SOL-2020-1", "name": "YulOptimizerRedundantAssignmentBreakContinue", "summary": "The Yul optimizer can remove essential assignments to variables declared inside for loops when Yul's continue or break statement is used. You are unlikely to be affected if you do not use inline assembly with for loops and continue and break statements.", "description": "The Yul optimizer has a stage that removes assignments to variables that are overwritten again or are not used in all following control-flow branches. This logic incorrectly removes such assignments to variables declared inside a for loop if they can be removed in a control-flow branch that ends with ``break`` or ``continue`` even though they cannot be removed in other control-flow branches. Variables declared outside of the respective for loop are not affected.", @@ -11,6 +225,16 @@ } }, { + "uid": "SOL-2020-2", + "name": "privateCanBeOverridden", + "summary": "Private methods can be overridden by inheriting contracts.", + "description": "While private methods of base contracts are not visible and cannot be called directly from the derived contract, it is still possible to declare a function of the same name and type and thus change the behaviour of the base contract's function.", + "introduced": "0.3.0", + "fixed": "0.5.17", + "severity": "low" + }, + { + "uid": "SOL-2020-1", "name": "YulOptimizerRedundantAssignmentBreakContinue0.5", "summary": "The Yul optimizer can remove essential assignments to variables declared inside for loops when Yul's continue or break statement is used. You are unlikely to be affected if you do not use inline assembly with for loops and continue and break statements.", "description": "The Yul optimizer has a stage that removes assignments to variables that are overwritten again or are not used in all following control-flow branches. This logic incorrectly removes such assignments to variables declared inside a for loop if they can be removed in a control-flow branch that ends with ``break`` or ``continue`` even though they cannot be removed in other control-flow branches. Variables declared outside of the respective for loop are not affected.", @@ -22,6 +246,7 @@ } }, { + "uid": "SOL-2019-10", "name": "ABIEncoderV2LoopYulOptimizer", "summary": "If both the experimental ABIEncoderV2 and the experimental Yul optimizer are activated, one component of the Yul optimizer may reuse data in memory that has been changed in the meantime.", "description": "The Yul optimizer incorrectly replaces ``mload`` and ``sload`` calls with values that have been previously written to the load location (and potentially changed in the meantime) if all of the following conditions are met: (1) there is a matching ``mstore`` or ``sstore`` call before; (2) the contents of memory or storage is only changed in a function that is called (directly or indirectly) in between the first store and the load call; (3) called function contains a for loop where the same memory location is changed in the condition or the post or body block. When used in Solidity mode, this can only happen if the experimental ABIEncoderV2 is activated and the experimental Yul optimizer has been activated manually in addition to the regular optimizer in the compiler settings.", @@ -35,6 +260,7 @@ } }, { + "uid": "SOL-2019-9", "name": "ABIEncoderV2CalldataStructsWithStaticallySizedAndDynamicallyEncodedMembers", "summary": "Reading from calldata structs that contain dynamically encoded, but statically-sized members can result in incorrect values.", "description": "When a calldata struct contains a dynamically encoded, but statically-sized member, the offsets for all subsequent struct members are calculated incorrectly. All reads from such members will result in invalid values. Only calldata structs are affected, i.e. this occurs in external functions with such structs as argument. Using affected structs in storage or memory or as arguments to public functions on the other hand works correctly.", @@ -46,17 +272,21 @@ } }, { + "uid": "SOL-2019-8", "name": "SignedArrayStorageCopy", "summary": "Assigning an array of signed integers to a storage array of different type can lead to data corruption in that array.", "description": "In two's complement, negative integers have their higher order bits set. In order to fit into a shared storage slot, these have to be set to zero. When a conversion is done at the same time, the bits to set to zero were incorrectly determined from the source and not the target type. This means that such copy operations can lead to incorrect values being stored.", + "link": "https://blog.soliditylang.org/2019/06/25/solidity-storage-array-bugs/", "introduced": "0.4.7", "fixed": "0.5.10", "severity": "low/medium" }, { + "uid": "SOL-2019-7", "name": "ABIEncoderV2StorageArrayWithMultiSlotElement", "summary": "Storage arrays containing structs or other statically-sized arrays are not read properly when directly encoded in external function calls or in abi.encode*.", "description": "When storage arrays whose elements occupy more than a single storage slot are directly encoded in external function calls or using abi.encode*, their elements are read in an overlapping manner, i.e. the element pointer is not properly advanced between reads. This is not a problem when the storage data is first copied to a memory variable or if the storage array only contains value types or dynamically-sized arrays.", + "link": "https://blog.soliditylang.org/2019/06/25/solidity-storage-array-bugs/", "introduced": "0.4.16", "fixed": "0.5.10", "severity": "low", @@ -65,6 +295,7 @@ } }, { + "uid": "SOL-2019-6", "name": "DynamicConstructorArgumentsClippedABIV2", "summary": "A contract's constructor that takes structs or arrays that contain dynamically-sized arrays reverts or decodes to invalid data.", "description": "During construction of a contract, constructor parameters are copied from the code section to memory for decoding. The amount of bytes to copy was calculated incorrectly in case all parameters are statically-sized but contain dynamically-sized arrays as struct members or inner arrays. Such types are only available if ABIEncoderV2 is activated.", @@ -76,6 +307,7 @@ } }, { + "uid": "SOL-2019-5", "name": "UninitializedFunctionPointerInConstructor", "summary": "Calling uninitialized internal function pointers created in the constructor does not always revert and can cause unexpected behaviour.", "description": "Uninitialized internal function pointers point to a special piece of code that causes a revert when called. Jump target positions are different during construction and after deployment, but the code for setting this special jump target only considered the situation after deployment.", @@ -84,6 +316,7 @@ "severity": "very low" }, { + "uid": "SOL-2019-5", "name": "UninitializedFunctionPointerInConstructor_0.4.x", "summary": "Calling uninitialized internal function pointers created in the constructor does not always revert and can cause unexpected behaviour.", "description": "Uninitialized internal function pointers point to a special piece of code that causes a revert when called. Jump target positions are different during construction and after deployment, but the code for setting this special jump target only considered the situation after deployment.", @@ -92,6 +325,7 @@ "severity": "very low" }, { + "uid": "SOL-2019-4", "name": "IncorrectEventSignatureInLibraries", "summary": "Contract types used in events in libraries cause an incorrect event signature hash", "description": "Instead of using the type `address` in the hashed signature, the actual contract name was used, leading to a wrong hash in the logs.", @@ -100,6 +334,7 @@ "severity": "very low" }, { + "uid": "SOL-2019-4", "name": "IncorrectEventSignatureInLibraries_0.4.x", "summary": "Contract types used in events in libraries cause an incorrect event signature hash", "description": "Instead of using the type `address` in the hashed signature, the actual contract name was used, leading to a wrong hash in the logs.", @@ -108,10 +343,11 @@ "severity": "very low" }, { + "uid": "SOL-2019-3", "name": "ABIEncoderV2PackedStorage", "summary": "Storage structs and arrays with types shorter than 32 bytes can cause data corruption if encoded directly from storage using the experimental ABIEncoderV2.", "description": "Elements of structs and arrays that are shorter than 32 bytes are not properly decoded from storage when encoded directly (i.e. not via a memory type) using ABIEncoderV2. This can cause corruption in the values themselves but can also overwrite other parts of the encoded data.", - "link": "https://blog.ethereum.org/2019/03/26/solidity-optimizer-and-abiencoderv2-bug/", + "link": "https://blog.soliditylang.org/2019/03/26/solidity-optimizer-and-abiencoderv2-bug/", "introduced": "0.5.0", "fixed": "0.5.7", "severity": "low", @@ -120,10 +356,11 @@ } }, { + "uid": "SOL-2019-3", "name": "ABIEncoderV2PackedStorage_0.4.x", "summary": "Storage structs and arrays with types shorter than 32 bytes can cause data corruption if encoded directly from storage using the experimental ABIEncoderV2.", "description": "Elements of structs and arrays that are shorter than 32 bytes are not properly decoded from storage when encoded directly (i.e. not via a memory type) using ABIEncoderV2. This can cause corruption in the values themselves but can also overwrite other parts of the encoded data.", - "link": "https://blog.ethereum.org/2019/03/26/solidity-optimizer-and-abiencoderv2-bug/", + "link": "https://blog.soliditylang.org/2019/03/26/solidity-optimizer-and-abiencoderv2-bug/", "introduced": "0.4.19", "fixed": "0.4.26", "severity": "low", @@ -132,10 +369,11 @@ } }, { + "uid": "SOL-2019-2", "name": "IncorrectByteInstructionOptimization", "summary": "The optimizer incorrectly handles byte opcodes whose second argument is 31 or a constant expression that evaluates to 31. This can result in unexpected values.", "description": "The optimizer incorrectly handles byte opcodes that use the constant 31 as second argument. This can happen when performing index access on bytesNN types with a compile-time constant value (not index) of 31 or when using the byte opcode in inline assembly.", - "link": "https://blog.ethereum.org/2019/03/26/solidity-optimizer-and-abiencoderv2-bug/", + "link": "https://blog.soliditylang.org/2019/03/26/solidity-optimizer-and-abiencoderv2-bug/", "introduced": "0.5.5", "fixed": "0.5.7", "severity": "very low", @@ -144,10 +382,11 @@ } }, { + "uid": "SOL-2019-1", "name": "DoubleShiftSizeOverflow", "summary": "Double bitwise shifts by large constants whose sum overflows 256 bits can result in unexpected values.", "description": "Nested logical shift operations whose total shift size is 2**256 or more are incorrectly optimized. This only applies to shifts by numbers of bits that are compile-time constant expressions.", - "link": "https://blog.ethereum.org/2019/03/26/solidity-optimizer-and-abiencoderv2-bug/", + "link": "https://blog.soliditylang.org/2019/03/26/solidity-optimizer-and-abiencoderv2-bug/", "introduced": "0.5.5", "fixed": "0.5.6", "severity": "low", @@ -157,35 +396,39 @@ } }, { + "uid": "SOL-2018-4", "name": "ExpExponentCleanup", "summary": "Using the ** operator with an exponent of type shorter than 256 bits can result in unexpected values.", "description": "Higher order bits in the exponent are not properly cleaned before the EXP opcode is applied if the type of the exponent expression is smaller than 256 bits and not smaller than the type of the base. In that case, the result might be larger than expected if the exponent is assumed to lie within the value range of the type. Literal numbers as exponents are unaffected as are exponents or bases of type uint256.", - "link": "https://blog.ethereum.org/2018/09/13/solidity-bugfix-release/", + "link": "https://blog.soliditylang.org/2018/09/13/solidity-bugfix-release/", "fixed": "0.4.25", "severity": "medium/high", "check": {"regex-source": "[^/]\\*\\* *[^/0-9 ]"} }, { + "uid": "SOL-2018-3", "name": "EventStructWrongData", "summary": "Using structs in events logged wrong data.", "description": "If a struct is used in an event, the address of the struct is logged instead of the actual data.", - "link": "https://blog.ethereum.org/2018/09/13/solidity-bugfix-release/", + "link": "https://blog.soliditylang.org/2018/09/13/solidity-bugfix-release/", "introduced": "0.4.17", "fixed": "0.4.25", "severity": "very low", "check": {"ast-compact-json-path": "$..[?(@.nodeType === 'EventDefinition')]..[?(@.nodeType === 'UserDefinedTypeName' && @.typeDescriptions.typeString.startsWith('struct'))]"} }, { + "uid": "SOL-2018-2", "name": "NestedArrayFunctionCallDecoder", "summary": "Calling functions that return multi-dimensional fixed-size arrays can result in memory corruption.", "description": "If Solidity code calls a function that returns a multi-dimensional fixed-size array, array elements are incorrectly interpreted as memory pointers and thus can cause memory corruption if the return values are accessed. Calling functions with multi-dimensional fixed-size arrays is unaffected as is returning fixed-size arrays from function calls. The regular expression only checks if such functions are present, not if they are called, which is required for the contract to be affected.", - "link": "https://blog.ethereum.org/2018/09/13/solidity-bugfix-release/", + "link": "https://blog.soliditylang.org/2018/09/13/solidity-bugfix-release/", "introduced": "0.1.4", "fixed": "0.4.22", "severity": "medium", "check": {"regex-source": "returns[^;{]*\\[\\s*[^\\] \\t\\r\\n\\v\\f][^\\]]*\\]\\s*\\[\\s*[^\\] \\t\\r\\n\\v\\f][^\\]]*\\][^{;]*[;{]"} }, { + "uid": "SOL-2018-1", "name": "OneOfTwoConstructorsSkipped", "summary": "If a contract has both a new-style constructor (using the constructor keyword) and an old-style constructor (a function with the same name as the contract) at the same time, one of them will be ignored.", "description": "If a contract has both a new-style constructor (using the constructor keyword) and an old-style constructor (a function with the same name as the contract) at the same time, one of them will be ignored. There will be a compiler warning about the old-style constructor, so contracts only using new-style constructors are fine.", @@ -194,6 +437,7 @@ "severity": "very low" }, { + "uid": "SOL-2017-5", "name": "ZeroFunctionSelector", "summary": "It is possible to craft the name of a function such that it is executed instead of the fallback function in very specific circumstances.", "description": "If a function has a selector consisting only of zeros, is payable and part of a contract that does not have a fallback function and at most five external functions in total, this function is called instead of the fallback function if Ether is sent to the contract without data.", @@ -201,6 +445,7 @@ "severity": "very low" }, { + "uid": "SOL-2017-4", "name": "DelegateCallReturnValue", "summary": "The low-level .delegatecall() does not return the execution outcome, but converts the value returned by the functioned called to a boolean instead.", "description": "The return value of the low-level .delegatecall() function is taken from a position in memory, where the call data or the return data resides. This value is interpreted as a boolean and put onto the stack. This means if the called function returns at least 32 zero bytes, .delegatecall() returns false even if the call was successful.", @@ -209,6 +454,7 @@ "severity": "low" }, { + "uid": "SOL-2017-3", "name": "ECRecoverMalformedInput", "summary": "The ecrecover() builtin can return garbage for malformed input.", "description": "The ecrecover precompile does not properly signal failure for malformed input (especially in the 'v' argument) and thus the Solidity function can return data that was previously present in the return area in memory.", @@ -216,6 +462,7 @@ "severity": "medium" }, { + "uid": "SOL-2017-2", "name": "SkipEmptyStringLiteral", "summary": "If \"\" is used in a function call, the following function arguments will not be correctly passed to the function.", "description": "If the empty string literal \"\" is used as an argument in a function call, it is skipped by the encoder. This has the effect that the encoding of all arguments following this is shifted left by 32 bytes and thus the function call data is corrupted.", @@ -223,10 +470,11 @@ "severity": "low" }, { + "uid": "SOL-2017-1", "name": "ConstantOptimizerSubtraction", "summary": "In some situations, the optimizer replaces certain numbers in the code with routines that compute different numbers.", "description": "The optimizer tries to represent any number in the bytecode by routines that compute them with less gas. For some special numbers, an incorrect routine is generated. This could allow an attacker to e.g. trick victims about a specific amount of ether, or function calls to call different functions (or none at all).", - "link": "https://blog.ethereum.org/2017/05/03/solidity-optimizer-bug/", + "link": "https://blog.soliditylang.org/2017/05/03/solidity-optimizer-bug/", "fixed": "0.4.11", "severity": "low", "conditions": { @@ -234,6 +482,7 @@ } }, { + "uid": "SOL-2016-11", "name": "IdentityPrecompileReturnIgnored", "summary": "Failure of the identity precompile was ignored.", "description": "Calls to the identity contract, which is used for copying memory, ignored its return value. On the public chain, calls to the identity precompile can be made in a way that they never fail, but this might be different on private chains.", @@ -241,6 +490,7 @@ "fixed": "0.4.7" }, { + "uid": "SOL-2016-10", "name": "OptimizerStateKnowledgeNotResetForJumpdest", "summary": "The optimizer did not properly reset its internal state at jump destinations, which could lead to data corruption.", "description": "The optimizer performs symbolic execution at certain stages. At jump destinations, multiple code paths join and thus it has to compute a common state from the incoming edges. Computing this common state was simplified to just use the empty state, but this implementation was not done properly. This bug can cause data corruption.", @@ -252,15 +502,17 @@ } }, { + "uid": "SOL-2016-9", "name": "HighOrderByteCleanStorage", "summary": "For short types, the high order bytes were not cleaned properly and could overwrite existing data.", "description": "Types shorter than 32 bytes are packed together into the same 32 byte storage slot, but storage writes always write 32 bytes. For some types, the higher order bytes were not cleaned properly, which made it sometimes possible to overwrite a variable in storage when writing to another one.", - "link": "https://blog.ethereum.org/2016/11/01/security-alert-solidity-variables-can-overwritten-storage/", + "link": "https://blog.soliditylang.org/2016/11/01/security-alert-solidity-variables-can-overwritten-storage/", "severity": "high", "introduced": "0.1.6", "fixed": "0.4.4" }, { + "uid": "SOL-2016-8", "name": "OptimizerStaleKnowledgeAboutSHA3", "summary": "The optimizer did not properly reset its knowledge about SHA3 operations resulting in some hashes (also used for storage variable positions) not being calculated correctly.", "description": "The optimizer performs symbolic execution in order to save re-evaluating expressions whose value is already known. This knowledge was not properly reset across control flow paths and thus the optimizer sometimes thought that the result of a SHA3 operation is already present on the stack. This could result in data corruption by accessing the wrong storage slot.", @@ -271,6 +523,7 @@ } }, { + "uid": "SOL-2016-7", "name": "LibrariesNotCallableFromPayableFunctions", "summary": "Library functions threw an exception when called from a call that received Ether.", "description": "Library functions are protected against sending them Ether through a call. Since the DELEGATECALL opcode forwards the information about how much Ether was sent with a call, the library function incorrectly assumed that Ether was sent to the library and threw an exception.", @@ -279,6 +532,7 @@ "fixed": "0.4.2" }, { + "uid": "SOL-2016-6", "name": "SendFailsForZeroEther", "summary": "The send function did not provide enough gas to the recipient if no Ether was sent with it.", "description": "The recipient of an Ether transfer automatically receives a certain amount of gas from the EVM to handle the transfer. In the case of a zero-transfer, this gas is not provided which causes the recipient to throw an exception.", @@ -286,6 +540,7 @@ "fixed": "0.4.0" }, { + "uid": "SOL-2016-5", "name": "DynamicAllocationInfiniteLoop", "summary": "Dynamic allocation of an empty memory array caused an infinite loop and thus an exception.", "description": "Memory arrays can be created provided a length. If this length is zero, code was generated that did not terminate and thus consumed all gas.", @@ -293,6 +548,7 @@ "fixed": "0.3.6" }, { + "uid": "SOL-2016-4", "name": "OptimizerClearStateOnCodePathJoin", "summary": "The optimizer did not properly reset its internal state at jump destinations, which could lead to data corruption.", "description": "The optimizer performs symbolic execution at certain stages. At jump destinations, multiple code paths join and thus it has to compute a common state from the incoming edges. Computing this common state was not done correctly. This bug can cause data corruption, but it is probably quite hard to use for targeted attacks.", @@ -303,6 +559,7 @@ } }, { + "uid": "SOL-2016-3", "name": "CleanBytesHigherOrderBits", "summary": "The higher order bits of short bytesNN types were not cleaned before comparison.", "description": "Two variables of type bytesNN were considered different if their higher order bits, which are not part of the actual value, were different. An attacker might use this to reach seemingly unreachable code paths by providing incorrectly formatted input data.", @@ -310,6 +567,7 @@ "fixed": "0.3.3" }, { + "uid": "SOL-2016-2", "name": "ArrayAccessCleanHigherOrderBits", "summary": "Access to array elements for arrays of types with less than 32 bytes did not correctly clean the higher order bits, causing corruption in other array elements.", "description": "Multiple elements of an array of values that are shorter than 17 bytes are packed into the same storage slot. Writing to a single element of such an array did not properly clean the higher order bytes and thus could lead to data corruption.", @@ -317,6 +575,7 @@ "fixed": "0.3.1" }, { + "uid": "SOL-2016-1", "name": "AncientCompiler", "summary": "This compiler version is ancient and might contain several undocumented or undiscovered bugs.", "description": "The list of bugs is only kept for compiler versions starting from 0.3.0, so older versions might contain undocumented bugs.", diff --git a/compiler/docs/bugs.rst b/compiler/docs/bugs.rst index 11680abc..75a23e49 100644 --- a/compiler/docs/bugs.rst +++ b/compiler/docs/bugs.rst @@ -19,20 +19,24 @@ which can be used to check which bugs affect a specific version of the compiler. Contract source verification tools and also other tools interacting with contracts should consult this list according to the following criteria: - - It is mildly suspicious if a contract was compiled with a nightly - compiler version instead of a released version. This list does not keep - track of unreleased or nightly versions. - - It is also mildly suspicious if a contract was compiled with a version that was - not the most recent at the time the contract was created. For contracts - created from other contracts, you have to follow the creation chain - back to a transaction and use the date of that transaction as creation date. - - It is highly suspicious if a contract was compiled with a compiler that - contains a known bug and the contract was created at a time where a newer - compiler version containing a fix was already released. +- It is mildly suspicious if a contract was compiled with a nightly + compiler version instead of a released version. This list does not keep + track of unreleased or nightly versions. +- It is also mildly suspicious if a contract was compiled with a version that was + not the most recent at the time the contract was created. For contracts + created from other contracts, you have to follow the creation chain + back to a transaction and use the date of that transaction as creation date. +- It is highly suspicious if a contract was compiled with a compiler that + contains a known bug and the contract was created at a time where a newer + compiler version containing a fix was already released. The JSON file of known bugs below is an array of objects, one for each bug, with the following keys: +uid + Unique identifier given to the bug in the form of ``SOL--``. + It is possible that multiple entries exists with the same uid. This means + multiple version ranges are affected by the same bug. name Unique name given to the bug summary diff --git a/compiler/docs/bugs_by_version.json b/compiler/docs/bugs_by_version.json index 5be71520..11ddd40b 100644 --- a/compiler/docs/bugs_by_version.json +++ b/compiler/docs/bugs_by_version.json @@ -1,6 +1,10 @@ { "0.1.0": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", "ExpExponentCleanup", "ZeroFunctionSelector", "ECRecoverMalformedInput", @@ -19,6 +23,10 @@ }, "0.1.1": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", "ExpExponentCleanup", "ZeroFunctionSelector", "ECRecoverMalformedInput", @@ -37,6 +45,10 @@ }, "0.1.2": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", "ExpExponentCleanup", "ZeroFunctionSelector", "ECRecoverMalformedInput", @@ -55,6 +67,10 @@ }, "0.1.3": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", "ExpExponentCleanup", "ZeroFunctionSelector", "ECRecoverMalformedInput", @@ -73,6 +89,10 @@ }, "0.1.4": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", "ZeroFunctionSelector", @@ -92,6 +112,10 @@ }, "0.1.5": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", "ZeroFunctionSelector", @@ -111,6 +135,11 @@ }, "0.1.6": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", "ZeroFunctionSelector", @@ -131,6 +160,11 @@ }, "0.1.7": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", "ZeroFunctionSelector", @@ -151,6 +185,12 @@ }, "0.2.0": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", "ZeroFunctionSelector", @@ -171,6 +211,12 @@ }, "0.2.1": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", "ZeroFunctionSelector", @@ -191,6 +237,12 @@ }, "0.2.2": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", "ZeroFunctionSelector", @@ -211,6 +263,13 @@ }, "0.3.0": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", @@ -232,6 +291,13 @@ }, "0.3.1": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", @@ -252,6 +318,13 @@ }, "0.3.2": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", @@ -272,6 +345,13 @@ }, "0.3.3": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", @@ -291,6 +371,13 @@ }, "0.3.4": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", @@ -310,6 +397,13 @@ }, "0.3.5": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", @@ -329,6 +423,13 @@ }, "0.3.6": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", @@ -346,6 +447,13 @@ }, "0.4.0": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", @@ -363,6 +471,13 @@ }, "0.4.1": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", @@ -380,6 +495,14 @@ }, "0.4.10": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "UninitializedFunctionPointerInConstructor_0.4.x", "IncorrectEventSignatureInLibraries_0.4.x", @@ -395,6 +518,14 @@ }, "0.4.11": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "UninitializedFunctionPointerInConstructor_0.4.x", "IncorrectEventSignatureInLibraries_0.4.x", @@ -409,6 +540,14 @@ }, "0.4.12": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "UninitializedFunctionPointerInConstructor_0.4.x", "IncorrectEventSignatureInLibraries_0.4.x", @@ -422,6 +561,14 @@ }, "0.4.13": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "UninitializedFunctionPointerInConstructor_0.4.x", "IncorrectEventSignatureInLibraries_0.4.x", @@ -435,6 +582,14 @@ }, "0.4.14": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "UninitializedFunctionPointerInConstructor_0.4.x", "IncorrectEventSignatureInLibraries_0.4.x", @@ -447,6 +602,14 @@ }, "0.4.15": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "UninitializedFunctionPointerInConstructor_0.4.x", "IncorrectEventSignatureInLibraries_0.4.x", @@ -458,6 +621,15 @@ }, "0.4.16": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -471,6 +643,15 @@ }, "0.4.17": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -485,6 +666,15 @@ }, "0.4.18": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -498,6 +688,15 @@ }, "0.4.19": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -512,6 +711,13 @@ }, "0.4.2": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", @@ -528,6 +734,15 @@ }, "0.4.20": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -542,6 +757,15 @@ }, "0.4.21": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -556,6 +780,15 @@ }, "0.4.22": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -570,6 +803,15 @@ }, "0.4.23": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -583,6 +825,15 @@ }, "0.4.24": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -596,6 +847,15 @@ }, "0.4.25": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -607,6 +867,15 @@ }, "0.4.26": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2" @@ -615,6 +884,13 @@ }, "0.4.3": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", @@ -630,6 +906,13 @@ }, "0.4.4": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", "NestedArrayFunctionCallDecoder", @@ -644,6 +927,14 @@ }, "0.4.5": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "UninitializedFunctionPointerInConstructor_0.4.x", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", @@ -660,6 +951,14 @@ }, "0.4.6": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "UninitializedFunctionPointerInConstructor_0.4.x", "IncorrectEventSignatureInLibraries_0.4.x", "ExpExponentCleanup", @@ -675,6 +974,14 @@ }, "0.4.7": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "UninitializedFunctionPointerInConstructor_0.4.x", "IncorrectEventSignatureInLibraries_0.4.x", @@ -690,6 +997,14 @@ }, "0.4.8": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "UninitializedFunctionPointerInConstructor_0.4.x", "IncorrectEventSignatureInLibraries_0.4.x", @@ -705,6 +1020,14 @@ }, "0.4.9": { "bugs": [ + "DirtyBytesArrayToStorage", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "UninitializedFunctionPointerInConstructor_0.4.x", "IncorrectEventSignatureInLibraries_0.4.x", @@ -720,6 +1043,15 @@ }, "0.5.0": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -731,6 +1063,15 @@ }, "0.5.1": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -742,6 +1083,17 @@ }, "0.5.10": { "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "YulOptimizerRedundantAssignmentBreakContinue0.5", "ABIEncoderV2CalldataStructsWithStaticallySizedAndDynamicallyEncodedMembers" ], @@ -749,24 +1101,69 @@ }, "0.5.11": { "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "YulOptimizerRedundantAssignmentBreakContinue0.5" ], "released": "2019-08-12" }, "0.5.12": { "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "YulOptimizerRedundantAssignmentBreakContinue0.5" ], "released": "2019-10-01" }, "0.5.13": { "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "YulOptimizerRedundantAssignmentBreakContinue0.5" ], "released": "2019-11-14" }, "0.5.14": { "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "MissingEscapingInFormatting", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "YulOptimizerRedundantAssignmentBreakContinue0.5", "ABIEncoderV2LoopYulOptimizer" ], @@ -774,16 +1171,66 @@ }, "0.5.15": { "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "MissingEscapingInFormatting", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "YulOptimizerRedundantAssignmentBreakContinue0.5" ], "released": "2019-12-17" }, "0.5.16": { - "bugs": [], + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "MissingEscapingInFormatting", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden" + ], "released": "2020-01-02" }, + "0.5.17": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "MissingEscapingInFormatting", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow" + ], + "released": "2020-03-17" + }, "0.5.2": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -795,6 +1242,15 @@ }, "0.5.3": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -806,6 +1262,15 @@ }, "0.5.4": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -817,6 +1282,15 @@ }, "0.5.5": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", "DynamicConstructorArgumentsClippedABIV2", @@ -830,6 +1304,15 @@ }, "0.5.6": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "ABIEncoderV2CalldataStructsWithStaticallySizedAndDynamicallyEncodedMembers", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", @@ -843,6 +1326,15 @@ }, "0.5.7": { "bugs": [ + "DirtyBytesArrayToStorage", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "ABIEncoderV2CalldataStructsWithStaticallySizedAndDynamicallyEncodedMembers", "SignedArrayStorageCopy", "ABIEncoderV2StorageArrayWithMultiSlotElement", @@ -854,6 +1346,17 @@ }, "0.5.8": { "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "YulOptimizerRedundantAssignmentBreakContinue0.5", "ABIEncoderV2CalldataStructsWithStaticallySizedAndDynamicallyEncodedMembers", "SignedArrayStorageCopy", @@ -864,6 +1367,17 @@ }, "0.5.9": { "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", + "privateCanBeOverridden", "YulOptimizerRedundantAssignmentBreakContinue0.5", "ABIEncoderV2CalldataStructsWithStaticallySizedAndDynamicallyEncodedMembers", "SignedArrayStorageCopy", @@ -873,16 +1387,472 @@ }, "0.6.0": { "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "MissingEscapingInFormatting", + "ArraySliceDynamicallyEncodedBaseType", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow", "YulOptimizerRedundantAssignmentBreakContinue" ], "released": "2019-12-17" }, "0.6.1": { - "bugs": [], + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "MissingEscapingInFormatting", + "ArraySliceDynamicallyEncodedBaseType", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow" + ], "released": "2020-01-02" }, + "0.6.10": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup" + ], + "released": "2020-06-11" + }, + "0.6.11": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup" + ], + "released": "2020-07-07" + }, + "0.6.12": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup" + ], + "released": "2020-07-22" + }, "0.6.2": { - "bugs": [], + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "MissingEscapingInFormatting", + "ArraySliceDynamicallyEncodedBaseType", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow" + ], "released": "2020-01-27" + }, + "0.6.3": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "MissingEscapingInFormatting", + "ArraySliceDynamicallyEncodedBaseType", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow" + ], + "released": "2020-02-18" + }, + "0.6.4": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "MissingEscapingInFormatting", + "ArraySliceDynamicallyEncodedBaseType", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents", + "MemoryArrayCreationOverflow" + ], + "released": "2020-03-10" + }, + "0.6.5": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "MissingEscapingInFormatting", + "ArraySliceDynamicallyEncodedBaseType", + "ImplicitConstructorCallvalueCheck", + "TupleAssignmentMultiStackSlotComponents" + ], + "released": "2020-04-06" + }, + "0.6.6": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "MissingEscapingInFormatting", + "ArraySliceDynamicallyEncodedBaseType", + "ImplicitConstructorCallvalueCheck" + ], + "released": "2020-04-09" + }, + "0.6.7": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "MissingEscapingInFormatting", + "ArraySliceDynamicallyEncodedBaseType", + "ImplicitConstructorCallvalueCheck" + ], + "released": "2020-05-04" + }, + "0.6.8": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup" + ], + "released": "2020-05-14" + }, + "0.6.9": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "UsingForCalldata" + ], + "released": "2020-06-04" + }, + "0.7.0": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup" + ], + "released": "2020-07-28" + }, + "0.7.1": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup", + "FreeFunctionRedefinition" + ], + "released": "2020-09-02" + }, + "0.7.2": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy", + "DynamicArrayCleanup" + ], + "released": "2020-09-28" + }, + "0.7.3": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching", + "EmptyByteArrayCopy" + ], + "released": "2020-10-07" + }, + "0.7.4": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching" + ], + "released": "2020-10-19" + }, + "0.7.5": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching" + ], + "released": "2020-11-18" + }, + "0.7.6": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching" + ], + "released": "2020-12-16" + }, + "0.8.0": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching" + ], + "released": "2020-12-16" + }, + "0.8.1": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching" + ], + "released": "2021-01-27" + }, + "0.8.10": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation" + ], + "released": "2021-11-09" + }, + "0.8.11": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "AbiEncodeCallLiteralAsFixedBytesBug" + ], + "released": "2021-12-20" + }, + "0.8.12": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "AbiEncodeCallLiteralAsFixedBytesBug" + ], + "released": "2022-02-16" + }, + "0.8.13": { + "bugs": [ + "StorageWriteRemovalBeforeConditionalTermination", + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "InlineAssemblyMemorySideEffects", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation" + ], + "released": "2022-03-16" + }, + "0.8.14": { + "bugs": [ + "StorageWriteRemovalBeforeConditionalTermination", + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "InlineAssemblyMemorySideEffects" + ], + "released": "2022-05-17" + }, + "0.8.15": { + "bugs": [ + "StorageWriteRemovalBeforeConditionalTermination", + "AbiReencodingHeadOverflowWithStaticArrayCleanup" + ], + "released": "2022-06-15" + }, + "0.8.16": { + "bugs": [ + "StorageWriteRemovalBeforeConditionalTermination" + ], + "released": "2022-08-08" + }, + "0.8.17": { + "bugs": [], + "released": "2022-09-08" + }, + "0.8.2": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory", + "KeccakCaching" + ], + "released": "2021-03-02" + }, + "0.8.3": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables", + "ABIDecodeTwoDimensionalArrayMemory" + ], + "released": "2021-03-23" + }, + "0.8.4": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables" + ], + "released": "2021-04-21" + }, + "0.8.5": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables" + ], + "released": "2021-06-10" + }, + "0.8.6": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables" + ], + "released": "2021-06-22" + }, + "0.8.7": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "SignedImmutables" + ], + "released": "2021-08-11" + }, + "0.8.8": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation", + "UserDefinedValueTypesBug", + "SignedImmutables" + ], + "released": "2021-09-27" + }, + "0.8.9": { + "bugs": [ + "AbiReencodingHeadOverflowWithStaticArrayCleanup", + "DirtyBytesArrayToStorage", + "DataLocationChangeInInternalOverride", + "NestedCallataArrayAbiReencodingSizeValidation" + ], + "released": "2021-09-29" } } \ No newline at end of file diff --git a/compiler/docs/cheatsheet.rst b/compiler/docs/cheatsheet.rst new file mode 100644 index 00000000..3a7d478b --- /dev/null +++ b/compiler/docs/cheatsheet.rst @@ -0,0 +1,114 @@ +********** +Cheatsheet +********** + +.. index:: operator; precedence + +Order of Precedence of Operators +================================ +.. include:: types/operator-precedence-table.rst + +.. 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.decode(bytes memory encodedData, (...)) returns (...)``: :ref:`ABI `-decodes + the provided data. The types are given in parentheses as second argument. + Example: ``(uint a, uint[2] memory b, bytes memory c) = abi.decode(data, (uint, uint[2], bytes))`` +- ``abi.encode(...) returns (bytes memory)``: :ref:`ABI `-encodes the given arguments +- ``abi.encodePacked(...) returns (bytes memory)``: Performs :ref:`packed encoding ` of + the given arguments. Note that this encoding can be ambiguous! +- ``abi.encodeWithSelector(bytes4 selector, ...) returns (bytes memory)``: :ref:`ABI `-encodes + the given arguments starting from the second and prepends the given four-byte selector +- ``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)), ...)`` +- ``bytes.concat(...) returns (bytes memory)``: :ref:`Concatenates variable number of + arguments to one byte array` +- ``string.concat(...) returns (string memory)``: :ref:`Concatenates variable number of + arguments to one string array` +- ``block.basefee`` (``uint``): current block's base fee (`EIP-3198 `_ and `EIP-1559 `_) +- ``block.chainid`` (``uint``): current chain id +- ``block.coinbase`` (``address payable``): current block miner's address +- ``block.difficulty`` (``uint``): current block difficulty +- ``block.gaslimit`` (``uint``): current block gaslimit +- ``block.number`` (``uint``): current block number +- ``block.timestamp`` (``uint``): current block timestamp in seconds since Unix epoch +- ``gasleft() returns (uint256)``: remaining gas +- ``msg.data`` (``bytes``): complete calldata +- ``msg.sender`` (``address``): sender of the message (current call) +- ``msg.sig`` (``bytes4``): first four bytes of the calldata (i.e. function identifier) +- ``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) +- ``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) +- ``require(bool condition, string memory message)``: abort execution and revert state changes if + 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 +- ``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 +- ``ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) returns (address)``: recover address associated with + the public key from elliptic curve signature, return zero on error +- ``addmod(uint x, uint y, uint k) returns (uint)``: compute ``(x + y) % k`` where the addition is performed with + 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. +- ``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 +- ``selfdestruct(address payable recipient)``: destroy the current contract, sending its funds to the given address +- ``
.balance`` (``uint256``): balance of the :ref:`address` in Wei +- ``
.code`` (``bytes memory``): code at the :ref:`address` (can be empty) +- ``
.codehash`` (``bytes32``): the codehash of the :ref:`address` +- ``
.send(uint256 amount) returns (bool)``: send given amount of Wei to :ref:`address`, + returns ``false`` on failure +- ``
.transfer(uint256 amount)``: send given amount of Wei to :ref:`address`, throws on failure +- ``type(C).name`` (``string``): the name of the contract +- ``type(C).creationCode`` (``bytes memory``): creation bytecode of the given contract, see :ref:`Type Information`. +- ``type(C).runtimeCode`` (``bytes memory``): runtime bytecode of the given contract, see :ref:`Type Information`. +- ``type(I).interfaceId`` (``bytes4``): value containing the EIP-165 interface identifier of the given interface, see :ref:`Type Information`. +- ``type(T).min`` (``T``): the minimum value representable by the integer type ``T``, see :ref:`Type Information`. +- ``type(T).max`` (``T``): the maximum value representable by the integer type ``T``, see :ref:`Type Information`. + + +.. index:: visibility, public, private, external, internal + +Function Visibility Specifiers +============================== + +.. code-block:: solidity + :force: + + function myFunction() returns (bool) { + return true; + } + +- ``public``: visible externally and internally (creates a :ref:`getter function` for storage/state variables) +- ``private``: only visible in the current contract +- ``external``: only visible externally (only for functions) - i.e. can only be message-called (via ``this.func``) +- ``internal``: only visible internally + + +.. index:: modifiers, pure, view, payable, constant, anonymous, indexed + +Modifiers +========= + +- ``pure`` for functions: Disallows modification or access of state. +- ``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. +- ``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. +- ``override``: States that this function, modifier or public state variable changes + the behaviour of a function or modifier in a base contract. + diff --git a/compiler/docs/common-patterns.rst b/compiler/docs/common-patterns.rst index ab25cb4b..1793ebd2 100644 --- a/compiler/docs/common-patterns.rst +++ b/compiler/docs/common-patterns.rst @@ -25,9 +25,10 @@ contract in order to become the "richest", inspired by In the following contract, if you are no longer the richest, you receive the funds of the person who is now the richest. -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.4; contract WithdrawalContract { address public richest; @@ -35,13 +36,17 @@ you receive the funds of the person who is now the richest. mapping (address => uint) pendingWithdrawals; - constructor() public payable { + /// The amount of Ether sent was not higher than + /// the currently highest amount. + error NotEnoughEther(); + + constructor() payable { richest = msg.sender; mostSent = msg.value; } function becomeRichest() public payable { - require(msg.value > mostSent, "Not enough money sent."); + if (msg.value <= mostSent) revert NotEnoughEther(); pendingWithdrawals[richest] += msg.value; richest = msg.sender; mostSent = msg.value; @@ -52,30 +57,35 @@ you receive the funds of the person who is now the richest. // Remember to zero the pending refund before // sending to prevent re-entrancy attacks pendingWithdrawals[msg.sender] = 0; - msg.sender.transfer(amount); + payable(msg.sender).transfer(amount); } } This is as opposed to the more intuitive sending pattern: -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.4; contract SendContract { address payable public richest; uint public mostSent; - constructor() public payable { - richest = msg.sender; + /// The amount of Ether sent was not higher than + /// the currently highest amount. + error NotEnoughEther(); + + constructor() payable { + richest = payable(msg.sender); mostSent = msg.value; } function becomeRichest() public payable { - require(msg.value > mostSent, "Not enough money sent."); + if (msg.value <= mostSent) revert NotEnoughEther(); // This line can cause problems (explained below). richest.transfer(msg.value); - richest = msg.sender; + richest = payable(msg.sender); mostSent = msg.value; } } @@ -119,16 +129,33 @@ functions and this is what this section is about. The use of **function modifiers** makes these restrictions highly readable. -:: +.. code-block:: solidity + :force: - pragma solidity >=0.4.22 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.4; contract AccessRestriction { // These will be assigned at the construction // phase, where `msg.sender` is the account // creating this contract. address public owner = msg.sender; - uint public creationTime = now; + uint public creationTime = block.timestamp; + + // Now follows a list of errors that + // this contract can generate together + // with a textual explanation in special + // comments. + + /// Sender not authorized for this + /// operation. + error Unauthorized(); + + /// Function called too early. + error TooEarly(); + + /// Not enough Ether sent with function call. + error NotEnoughEther(); // Modifiers can be used to change // the body of a function. @@ -136,32 +163,28 @@ 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) { - require( - msg.sender == _account, - "Sender not authorized." - ); + if (msg.sender != account) + revert Unauthorized(); // Do not forget the "_;"! It will // be replaced by the actual function // body when the modifier is used. _; } - /// 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) { - require( - now >= _time, - "Function called too early." - ); + modifier onlyAfter(uint time) { + if (block.timestamp < time) + revert TooEarly(); _; } @@ -182,24 +205,23 @@ 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) { - require( - msg.value >= _amount, - "Not enough Ether provided." - ); + modifier costs(uint amount) { + if (msg.value < amount) + revert NotEnoughEther(); + _; - if (msg.value > _amount) - 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 (uint(owner) & 0 == 1) + if (uint160(owner) & 0 == 1) // This did not refund for Solidity // before version 0.4.0. return; @@ -245,7 +267,7 @@ the modifier ``atStage`` ensures that the function can only be called at a certain stage. Automatic timed transitions -are handled by the modifier ``timeTransitions``, which +are handled by the modifier ``timedTransitions``, which should be used for all functions. .. note:: @@ -271,9 +293,11 @@ function finishes. Starting with version 0.4.0, modifier code will run even if the function explicitly returns. -:: +.. code-block:: solidity + :force: - pragma solidity >=0.4.22 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.4; contract StateMachine { enum Stages { @@ -283,17 +307,17 @@ function finishes. AreWeDoneYet, Finished } + /// Function cannot be called at this time. + error FunctionInvalidAtThisStage(); // This is the current stage. Stages public stage = Stages.AcceptingBlindedBids; - uint public creationTime = now; + uint public creationTime = block.timestamp; - modifier atStage(Stages _stage) { - require( - stage == _stage, - "Function cannot be called at this time." - ); + modifier atStage(Stages stage_) { + if (stage != stage_) + revert FunctionInvalidAtThisStage(); _; } @@ -306,10 +330,10 @@ function finishes. // will not take the new stage into account. modifier timedTransitions() { if (stage == Stages.AcceptingBlindedBids && - now >= creationTime + 10 days) + block.timestamp >= creationTime + 10 days) nextStage(); if (stage == Stages.RevealBids && - now >= creationTime + 12 days) + block.timestamp >= creationTime + 12 days) nextStage(); // The other stages transition by transaction _; diff --git a/compiler/docs/conf.py b/compiler/docs/conf.py index c8d60690..10aa406f 100644 --- a/compiler/docs/conf.py +++ b/compiler/docs/conf.py @@ -17,18 +17,21 @@ import os import re -from pygments_lexer_solidity import SolidityLexer +from pygments_lexer_solidity import SolidityLexer, YulLexer # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. +ROOT_PATH = os.path.dirname(os.path.realpath(__file__)) + +sys.path.insert(0, os.path.join(ROOT_PATH, 'ext')) + def setup(sphinx): - thisdir = os.path.dirname(os.path.realpath(__file__)) - sys.path.insert(0, thisdir + '/utils') - sphinx.add_lexer('Solidity', SolidityLexer()) + sphinx.add_lexer('Solidity', SolidityLexer) + sphinx.add_lexer('Yul', YulLexer) - sphinx.add_stylesheet('css/custom.css') + sphinx.add_css_file('css/custom.css') # -- General configuration ------------------------------------------------ @@ -38,7 +41,13 @@ def setup(sphinx): # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [] +extensions = [ + 'sphinx_a4doc', + 'html_extra_template_renderer', + 'remix_code_links', +] + +a4_base_path = os.path.dirname(__file__) + '/grammar' # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -54,17 +63,17 @@ def setup(sphinx): # General information about the project. project = 'Solidity' -copyright = '2016-2020, Ethereum' +project_copyright = '2016-2021, Ethereum' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -with open('../CMakeLists.txt', 'r') as f: +with open('../CMakeLists.txt', 'r', encoding='utf8') as f: version = re.search('PROJECT_VERSION "([^"]+)"', f.read()).group(1) # The full version, including alpha/beta/rc tags. -if os.path.isfile('../prerelease.txt') != True or os.path.getsize('../prerelease.txt') == 0: +if not os.path.isfile('../prerelease.txt') or os.path.getsize('../prerelease.txt') == 0: release = version else: # This is a prerelease version @@ -82,7 +91,7 @@ def setup(sphinx): # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build', 'contracts', 'types', 'examples'] +exclude_patterns = ['_build', 'contracts', 'types', 'examples', 'grammar'] # The reST default role (used for this markup: `text`) to use for all # documents. @@ -120,7 +129,11 @@ def setup(sphinx): # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} +html_theme_options = { + 'logo_only': True, + 'style_nav_header_background': '#65afff', + 'display_version': True, +} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] @@ -134,7 +147,7 @@ def setup(sphinx): # The name of an image file (relative to this directory) to place at the top # of the sidebar. -#html_logo = None +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 @@ -146,10 +159,27 @@ def setup(sphinx): # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] +html_css_files = ["css/toggle.css"] + +html_js_files = ["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 # directly to the root of the documentation. -#html_extra_path = [] +html_extra_path = ["_static/css"] + +# List of templates of static files to be included in the HTML output. +# Keys represent paths to input files and values are dicts containing: +# - target: The path where the rendered template should be placed. +# - context: A dictionary listing variables that can be used inside the template. +# All paths must be absolute. +# Rendered templates are automatically added to html_extra_path setting. +html_extra_templates = { + os.path.join(ROOT_PATH, "robots.txt.template"): { + 'target': os.path.join(ROOT_PATH, "_static/robots.txt"), + 'context': {'LATEST_VERSION': version}, + } +} # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. @@ -213,7 +243,7 @@ def setup(sphinx): # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('index', 'solidity.tex', 'Solidity Documentation', 'Ethereum', 'manual'), + ('index', 'solidity.tex', 'Solidity Documentation', 'Ethereum', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of diff --git a/compiler/docs/contracts.rst b/compiler/docs/contracts.rst index 1426bfd1..aee26c95 100644 --- a/compiler/docs/contracts.rst +++ b/compiler/docs/contracts.rst @@ -24,6 +24,7 @@ There is no "cron" concept in Ethereum to call a function at a particular event .. include:: contracts/functions.rst .. include:: contracts/events.rst +.. include:: contracts/errors.rst .. include:: contracts/inheritance.rst diff --git a/compiler/docs/contracts/abstract-contracts.rst b/compiler/docs/contracts/abstract-contracts.rst index 51db0dfb..fb1beb2d 100644 --- a/compiler/docs/contracts/abstract-contracts.rst +++ b/compiler/docs/contracts/abstract-contracts.rst @@ -6,30 +6,39 @@ 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). - pragma solidity >=0.4.0 <0.7.0; +.. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.0 <0.9.0; abstract contract Feline { function utterance() public virtual returns (bytes32); } Such abstract contracts can not be instantiated directly. This is also true, if an abstract contract itself does implement -all defined functions. The usage of an abstract contract as a base class is shown in the following example:: +all defined functions. The usage of an abstract contract as a base class is shown in the following example: + +.. code-block:: solidity - pragma solidity ^0.6.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.0 <0.9.0; abstract contract Feline { - function utterance() public virtual returns (bytes32); + function utterance() public pure virtual returns (bytes32); } contract Cat is Feline { - function utterance() public override returns (bytes32) { return "miaow"; } + function utterance() public pure override returns (bytes32) { return "miaow"; } } If a contract inherits from an abstract contract and does not implement all non-implemented @@ -38,11 +47,15 @@ functions by overriding, it needs to be marked as abstract as well. Note that a function without implementation is different from a :ref:`Function Type ` even though their syntax looks very similar. -Example of function without implementation (a function declaration):: +Example of function without implementation (a function declaration): + +.. code-block:: solidity function foo(address) external returns (address); -Example of a declaration of a variable whose type is a function type:: +Example of a declaration of a variable whose type is a function type: + +.. code-block:: solidity function(address) external returns (address) foo; @@ -52,3 +65,8 @@ facilitating patterns like the `Template method ` (only for constants) and :ref:`value types `. + +.. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.4; + + uint constant X = 32**22 + 8; + + contract C { + string constant TEXT = "abc"; + bytes32 constant MY_HASH = keccak256("abc"); + uint immutable decimals; + uint immutable maxBalance; + address immutable owner = msg.sender; + + constructor(uint decimals_, address ref) { + decimals = decimals_; + // Assignments to immutables can even access the environment. + maxBalance = ref.balance; + } + + function isBalanceTooHigh(address other) public view returns (bool) { + return other.balance > maxBalance; + } + } + + +Constant +======== + +For ``constant`` variables, the value has to be a constant at compile time and it has to be +assigned where the variable is declared. Any expression +that accesses storage, blockchain data (e.g. ``block.timestamp``, ``address(this).balance`` or ``block.number``) or execution data (``msg.value`` or ``gasleft()``) or makes calls to external contracts is disallowed. Expressions that might have a side-effect on memory allocation are allowed, but those that @@ -18,18 +70,29 @@ The reason behind allowing side-effects on the memory allocator is that it should be possible to construct complex objects like e.g. lookup-tables. This feature is not yet fully usable. -The compiler does not reserve a storage slot for these variables, and every occurrence is -replaced by the respective constant expression (which might be computed to a single value by the optimizer). +Immutable +========= -Not all types for constants are implemented at this time. The only supported types are -value types and strings. +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. -:: +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 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. - pragma solidity >=0.4.0 <0.7.0; +.. 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. - contract C { - uint constant X = 32**22 + 8; - string constant TEXT = "abc"; - bytes32 constant MY_HASH = keccak256("abc"); - } + This is a safeguard against different interpretations about the order + of state variable initialization and constructor execution, especially + with regards to inheritance. diff --git a/compiler/docs/contracts/creating-contracts.rst b/compiler/docs/contracts/creating-contracts.rst index 90578f78..f574a5a6 100644 --- a/compiler/docs/contracts/creating-contracts.rst +++ b/compiler/docs/contracts/creating-contracts.rst @@ -32,9 +32,10 @@ If a contract wants to create another contract, the source code (and the binary) of the created contract has to be known to the creator. This means that cyclic creation dependencies are impossible. -:: +.. code-block:: solidity - pragma solidity >=0.4.22 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.22 <0.9.0; contract OwnedToken { @@ -47,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) public { + 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`, @@ -64,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 { diff --git a/compiler/docs/contracts/errors.rst b/compiler/docs/contracts/errors.rst new file mode 100644 index 00000000..19577a38 --- /dev/null +++ b/compiler/docs/contracts/errors.rst @@ -0,0 +1,86 @@ +.. index:: ! error, revert, ! selector; of an error +.. _errors: + +******************************* +Errors and the Revert Statement +******************************* + +Errors in Solidity provide a convenient and gas-efficient way to explain to the +user why an operation failed. They can be defined inside and outside of contracts (including interfaces and libraries). + +They have to be used together with the :ref:`revert statement ` +which causes +all changes in the current call to be reverted and passes the error data back to the +caller. + +.. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.4; + + /// Insufficient balance for transfer. Needed `required` but only + /// `available` available. + /// @param available balance available. + /// @param required requested amount to transfer. + error InsufficientBalance(uint256 available, uint256 required); + + contract TestToken { + mapping(address => uint) balance; + function transfer(address to, uint256 amount) public { + if (amount > balance[msg.sender]) + revert InsufficientBalance({ + available: balance[msg.sender], + required: amount + }); + balance[msg.sender] -= amount; + balance[to] += amount; + } + // ... + } + +Errors cannot be overloaded or overridden but are inherited. +The same error can be defined in multiple places as long as the scopes are distinct. +Instances of errors can only be created using ``revert`` statements. + +The error creates data that is then passed to the caller with the revert operation +to either return to the off-chain component or catch it in a :ref:`try/catch statement `. +Note that an error can only be caught when coming from an external call, +reverts happening in internal calls or inside the same function cannot be caught. + +If you do not provide any parameters, the error only needs four bytes of +data and you can use :ref:`NatSpec ` as above +to further explain the reasons behind the error, which is not stored on chain. +This makes this a very cheap and convenient error-reporting feature at the same time. + +More specifically, an error instance is ABI-encoded in the same way as +a function call to a function of the same name and types would be +and then used as the return data in the ``revert`` opcode. +This means that the data consists of a 4-byte selector followed by :ref:`ABI-encoded` data. +The selector consists of the first four bytes of the keccak256-hash of the signature of the error type. + +.. note:: + It is possible for a contract to revert + with different errors of the same name or even with errors defined in different places + that are indistinguishable by the caller. For the outside, i.e. the ABI, + only the name of the error is relevant, not the contract or file where it is defined. + +The statement ``require(condition, "description");`` would be equivalent to +``if (!condition) revert Error("description")`` if you could define +``error Error(string)``. +Note, however, that ``Error`` is a built-in type and cannot be defined in user-supplied code. + +Similarly, a failing ``assert`` or similar conditions will revert with an error +of the built-in type ``Panic(uint256)``. + +.. note:: + Error data should only be used to give an indication of failure, but + not as a means for control-flow. The reason is that the revert data + of inner calls is propagated back through the chain of external calls + 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. diff --git a/compiler/docs/contracts/events.rst b/compiler/docs/contracts/events.rst index 46b426d8..8618e752 100644 --- a/compiler/docs/contracts/events.rst +++ b/compiler/docs/contracts/events.rst @@ -1,4 +1,4 @@ -.. index:: ! event +.. index:: ! event, ! event; anonymous, ! event; indexed, ! event; topic .. _events: @@ -24,9 +24,10 @@ because the contract can only see the last 256 block hashes. You can add the attribute ``indexed`` to up to three parameters which adds them to a special data structure known as :ref:`"topics" ` instead of -the data part of the log. If you use arrays (including ``string`` and ``bytes``) -as indexed arguments, its Keccak-256 hash is stored as a topic instead, this is -because a topic can only hold a single word (32 bytes). +the data part of the log. +A topic can only hold a single word (32 bytes) so if you use a :ref:`reference type +` for an indexed argument, the Keccak-256 hash of the value is stored +as a topic instead. All parameters without the ``indexed`` attribute are :ref:`ABI-encoded ` into the data part of the log. @@ -61,41 +62,63 @@ The hash of the signature of the event is one of the topics, except if you declared the event with the ``anonymous`` specifier. This means that it is not possible to filter for specific anonymous events by name, you can only filter by the contract address. The advantage of anonymous events -is that they are cheaper to deploy and call. +is that they are cheaper to deploy and call. It also allows you to declare +four indexed arguments rather than three. -:: +.. note:: + Since the transaction log only stores the event data and not the type, + you have to know the type of the event, including which parameter is + indexed and if the event is anonymous in order to correctly interpret + the data. + In particular, it is possible to "fake" the signature of another event + using an anonymous event. - pragma solidity >=0.4.21 <0.7.0; +.. 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 + pragma solidity >=0.4.21 <0.9.0; 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); } } The use in the JavaScript API is as follows: -:: +.. code-block:: javascript var abi = /* abi as generated by the compiler */; var ClientReceipt = web3.eth.contract(abi); var clientReceipt = ClientReceipt.at("0x1234...ab67" /* address */); - var event = clientReceipt.Deposit(); + var depositEvent = clientReceipt.Deposit(); // watch for changes - event.watch(function(error, result){ + depositEvent.watch(function(error, result){ // result contains non-indexed arguments and topics // given to the `Deposit` call. if (!error) @@ -104,7 +127,7 @@ The use in the JavaScript API is as follows: // Or pass a callback to start watching immediately - var event = clientReceipt.Deposit(function(error, result) { + var depositEvent = clientReceipt.Deposit(function(error, result) { if (!error) console.log(result); }); @@ -113,51 +136,21 @@ The output of the above looks like the following (trimmed): .. code-block:: json - { - "returnValues": { - "_from": "0x1111…FFFFCCCC", - "_id": "0x50…sd5adb20", - "_value": "0x420042" - }, - "raw": { - "data": "0x7f…91385", - "topics": ["0xfd4…b4ead7", "0x7f…1a91385"] - } - } - -.. index:: ! log - -Low-Level Interface to Logs -=========================== - -It is also possible to access the low-level interface to the logging -mechanism via the functions ``log0``, ``log1``, ``log2``, ``log3`` and ``log4``. -Each function ``logi`` takes ``i + 1`` parameter of type ``bytes32``, where the first -argument will be used for the data part of the log and the others -as topics. The event call above can be performed in the same way as - -:: - - pragma solidity >=0.4.10 <0.7.0; - - contract C { - function f() public payable { - uint256 _id = 0x420042; - log3( - bytes32(msg.value), - bytes32(0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20), - bytes32(uint256(msg.sender)), - bytes32(_id) - ); - } + { + "returnValues": { + "from": "0x1111…FFFFCCCC", + "id": "0x50…sd5adb20", + "value": "0x420042" + }, + "raw": { + "data": "0x7f…91385", + "topics": ["0xfd4…b4ead7", "0x7f…1a91385"] + } } -where the long hexadecimal number is equal to -``keccak256("Deposit(address,bytes32,uint256)")``, the signature of the event. - Additional Resources for Understanding Events -============================================== +============================================= -- `Javascript documentation `_ -- `Example usage of events `_ -- `How to access them in js `_ +- `Javascript documentation `_ +- `Example usage of events `_ +- `How to access them in js `_ diff --git a/compiler/docs/contracts/function-modifiers.rst b/compiler/docs/contracts/function-modifiers.rst index 758ba74e..f2311954 100644 --- a/compiler/docs/contracts/function-modifiers.rst +++ b/compiler/docs/contracts/function-modifiers.rst @@ -15,12 +15,13 @@ inheritable properties of contracts and may be overridden by derived contracts, if they are marked ``virtual``. For details, please see :ref:`Modifier Overriding `. -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.1 <0.9.0; contract owned { - constructor() public { owner = msg.sender; } + constructor() { owner = payable(msg.sender); } address payable owner; // This contract only defines a modifier but does not use @@ -62,7 +63,7 @@ if they are marked ``virtual``. For details, please see mapping (address => bool) registeredAddresses; uint price; - constructor(uint initialPrice) public { price = initialPrice; } + constructor(uint initialPrice) { price = initialPrice; } // It is important to also provide the // `payable` keyword here, otherwise the function will @@ -71,8 +72,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_; } } @@ -99,16 +100,38 @@ if they are marked ``virtual``. For details, please see } } +If you want to access a modifier ``m`` defined in a contract ``C``, you can use ``C.m`` to +reference it without virtual lookup. It is only possible to use modifiers defined in the current +contract or its base contracts. Modifiers can also be defined in libraries but their use is +limited to functions of the same library. + Multiple modifiers are applied to a function by specifying them in a 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. + .. warning:: In an earlier version of Solidity, ``return`` statements in functions having modifiers behaved differently. -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. +An explicit return from a modifier with ``return;`` does not affect the values returned by the function. +The modifier can, however, choose not to execute the function body at all and in that case the return +variables are set to their :ref:`default values` just as if the function had an empty +body. + +The ``_`` symbol can appear in the modifier multiple times. Each occurrence is replaced with +the function body. Arbitrary expressions are allowed for modifier arguments and in this context, all symbols visible from the function are visible in the modifier. Symbols diff --git a/compiler/docs/contracts/functions.rst b/compiler/docs/contracts/functions.rst index 66166302..f14e4b8a 100644 --- a/compiler/docs/contracts/functions.rst +++ b/compiler/docs/contracts/functions.rst @@ -6,6 +6,41 @@ Functions ********* +Functions can be defined inside and outside of contracts. + +Functions outside of a contract, also called "free functions", always have implicit ``internal`` +:ref:`visibility`. Their code is included in all contracts +that call them, similar to internal library functions. + +.. code-block:: solidity + + // 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]; + } + + contract ArrayExample { + bool found; + 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); + require(s >= 10); + found = true; + } + } + +.. note:: + Functions defined outside a contract are still always executed + 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 the variable ``this``, storage variables and functions + not in their scope. + .. _function-parameters-return-variables: Function Parameters and Return Variables @@ -21,29 +56,22 @@ Function parameters are declared the same way as variables, and the name of unused parameters can be omitted. For example, if you want your contract to accept one kind of external call -with two integers, you would use something like the following:: +with two integers, you would use something like the following: + +.. code-block:: solidity - pragma solidity >=0.4.16 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.16 <0.9.0; 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` cannot accept a - multi-dimensional array as an input - parameter. This functionality is possible if you enable the new - ``ABIEncoderV2`` feature by adding ``pragma experimental ABIEncoderV2;`` to your source file. - - An :ref:`internal function` 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 @@ -53,18 +81,21 @@ Function return variables are declared with the same syntax after the ``returns`` keyword. For example, suppose you want to return two results: the sum and the product of -two integers passed as function parameters, then you use something like:: +two integers passed as function parameters, then you use something like: + +.. code-block:: solidity - pragma solidity >=0.4.16 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + 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; } } @@ -74,33 +105,40 @@ are initialized with their :ref:`default value ` and have that value until they are (re-)assigned. You can either explicitly assign to return variables and -then leave the function using ``return;``, +then leave the function as above, or you can provide return values (either a single or :ref:`multiple ones`) directly with the ``return`` -statement:: +statement: - pragma solidity >=0.4.16 <0.7.0; +.. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + 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); } } -This form is equivalent to first assigning values to the -return variables and then using ``return;`` to leave the function. +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 - new ``ABIEncoderV2`` feature by adding ``pragma experimental - ABIEncoderV2;`` 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 `), + - structs (applies only to :ref:`ABI coder v1 `). + + This restriction does not apply to library functions because of their different :ref:`internal ABI `. .. _multi-return: @@ -111,12 +149,17 @@ When a function has multiple return types, the statement ``return (v0, v1, ..., The number of components must be the same as the number of return variables and their types have to match, potentially after an :ref:`implicit conversion `. +.. _state-mutability: + +State Mutability +================ + .. index:: ! view function, function;view .. _view-functions: View Functions -============== +-------------- Functions can be declared ``view`` in which case they promise not to modify the state. @@ -140,13 +183,14 @@ The following statements are considered modifying the state: #. Using low-level calls. #. Using inline assembly that contains certain opcodes. -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.5.0 <0.9.0; contract C { function f(uint a, uint b) public view returns (uint) { - return a * (b + 42) + now; + return a * (b + 42) + block.timestamp; } } @@ -169,9 +213,12 @@ The following statements are considered modifying the state: .. _pure-functions: Pure Functions -============== +-------------- Functions can be declared ``pure`` in which case they promise not to read from or modify the state. +In particular, it should be possible to evaluate a ``pure`` function at compile-time given +only its inputs and ``msg.data``, but without any knowledge of the current blockchain state. +This means that reading from ``immutable`` variables can be a non-pure operation. .. note:: If the compiler's EVM target is Byzantium or newer (default) the opcode ``STATICCALL`` is used, @@ -185,9 +232,10 @@ In addition to the list of state modifying statements explained above, the follo #. Calling any function not marked ``pure``. #. Using inline assembly that contains certain opcodes. -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.5.0 <0.9.0; contract C { function f(uint a, uint b) public pure returns (uint) { @@ -195,7 +243,7 @@ In addition to the list of state modifying statements explained above, the follo } } -Pure functions are able to use the `revert()` and `require()` functions to revert +Pure functions are able to use the ``revert()`` and ``require()`` functions to revert potential state changes when an :ref:`error occurs `. Reverting a state change is not considered a "state modification", as only changes to the @@ -224,28 +272,36 @@ This behaviour is also in line with the ``STATICCALL`` opcode. not do state-changing operations, but it cannot check that the contract that will be called at runtime is actually of that type. +.. _special-functions: + +Special Functions +================= + .. index:: ! receive ether function, function;receive ! receive .. _receive-ether-function: Receive Ether Function -====================== +---------------------- A contract can have at most one ``receive`` function, declared using ``receive() external payable { ... }`` (without the ``function`` keyword). This function cannot have arguments, cannot return anything and must have -``external`` visibility and ``payable`` state mutability. It is executed on a +``external`` visibility and ``payable`` state mutability. +It can be virtual, can override and can have modifiers. + +The receive function is executed on a call to the contract with empty calldata. This is the function that is executed -on plain Ether transfers (e.g. via `.send()` or `.transfer()`). If no such +on plain Ether transfers (e.g. via ``.send()`` or ``.transfer()``). If no such function exists, but a payable :ref:`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 exception. -In the worst case, the fallback function can only rely on 2300 gas being -available (for example when `send` or `transfer` is used), leaving little +In the worst case, the ``receive`` function can only rely on 2300 gas being +available (for example when ``send`` or ``transfer`` is used), leaving little room to perform other operations except basic logging. The following operations will consume more gas than the 2300 gas stipend: @@ -255,17 +311,18 @@ 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:: A contract without a receive Ether function can receive Ether as a - recipient of a `coinbase transaction` (aka `miner block reward`) + recipient of a *coinbase transaction* (aka *miner block reward*) or as a destination of a ``selfdestruct``. A contract cannot react to such Ether transfers and thus also @@ -278,9 +335,10 @@ will consume more gas than the 2300 gas stipend: Below you can see an example of a Sink contract that uses function ``receive``. -:: +.. code-block:: solidity - pragma solidity ^0.6.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.0 <0.9.0; // This contract keeps all Ether sent to it with no way // to get it back. @@ -296,17 +354,24 @@ Below you can see an example of a Sink contract that uses function ``receive``. .. _fallback-function: Fallback Function -================= +----------------- -A contract can have at most one ``fallback`` function, declared using ``fallback () external [payable]`` -(without the ``function`` keyword). -This function cannot have arguments, cannot return anything and must have ``external`` visibility. -It is executed on a call to the contract if none of the other +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)`` +(both without the ``function`` keyword). +This function must have ``external`` visibility. A fallback function can be virtual, can override +and can have modifiers. + +The fallback function is executed on a call to the contract if none of the other functions match the given function signature, or if no data was supplied at all and there is no :ref:`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 +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 place of a receive function, it can only rely on 2300 gas being available (see :ref:`receive Ether function ` @@ -323,31 +388,33 @@ operations as long as there is enough gas passed on to it. to distinguish Ether transfers from interface confusions. .. note:: - Even though the fallback function cannot have arguments, one can still use ``msg.data`` to retrieve - any payload supplied with the call. - After having checked the first four bytes of ``msg.data``, + If you want to decode the input data, you can check the first four bytes + 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(msg.data[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. -:: +.. code-block:: solidity - pragma solidity >0.6.1 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.2 <0.9.0; contract Test { + uint x; // This function is called for all messages sent to // this contract (there is no other function). // Sending Ether to this contract will cause an exception, // because the fallback function does not have the `payable` // modifier. fallback() external { x = 1; } - uint x; } contract TestPayable { + uint x; + uint y; // This function is called for all messages sent to // this contract, except plain Ether transfers // (there is no other function except the receive function). @@ -358,8 +425,6 @@ operations as long as there is enough gas passed on to it. // This function is called for plain Ether transfers, i.e. // for every call with empty calldata. receive() external payable { x = 2; y = msg.value; } - uint x; - uint y; } contract Caller { @@ -387,8 +452,13 @@ operations as long as there is enough gas passed on to it. // results in test.x becoming == 1 and test.y becoming 1. // If someone sends Ether to that contract, the receive function in TestPayable will be called. - require(address(test).send(2 ether)); + // Since that function writes to storage, it takes more gas than is available with a + // simple ``send`` or ``transfer``. Because of that, we have to use a low-level call. + (success,) = address(test).call{value: 2 ether}(""); + require(success); // results in test.x becoming == 2 and test.y becoming 2 ether. + + return true; } } @@ -405,36 +475,38 @@ This process is called "overloading" and also applies to inherited functions. The following example shows overloading of the function ``f`` in the scope of contract ``A``. -:: +.. code-block:: solidity - pragma solidity >=0.4.16 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + 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; } } Overloaded functions are also present in the external interface. It is an error if two externally visible functions differ by their Solidity types but not by their external types. -:: +.. code-block:: solidity - pragma solidity >=0.4.16 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.16 <0.9.0; // 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; } } @@ -456,17 +528,18 @@ candidate, resolution fails. .. note:: Return parameters are not taken into account for overload resolution. -:: +.. code-block:: solidity - pragma solidity >=0.4.16 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + 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; } } diff --git a/compiler/docs/contracts/inheritance.rst b/compiler/docs/contracts/inheritance.rst index 18c369df..a33a36d2 100644 --- a/compiler/docs/contracts/inheritance.rst +++ b/compiler/docs/contracts/inheritance.rst @@ -36,13 +36,14 @@ some :ref:`differences `. Details are given in the following example. -:: +.. code-block:: solidity - pragma solidity ^0.6.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; contract Owned { - constructor() public { owner = msg.sender; } + constructor() { owner = payable(msg.sender); } address payable owner; } @@ -75,11 +76,11 @@ 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) public { + constructor(bytes32 name) { Config config = Config(0xD5f9D8D94886E70b06E474c3fB14Fd43E2f23970); NameReg(config.lookup(1)).register(name); } @@ -105,8 +106,8 @@ Details are given in the following example. // If a constructor takes an argument, it needs to be - // provided in the header (or modifier-invocation-style at - // the constructor of the derived contract (see below)). + // provided in the header or modifier-invocation-style at + // the constructor of the derived contract (see below). contract PriceFeed is Owned, Destructible, Named("GoldFeed") { function updateInfo(uint newInfo) public { if (msg.sender == owner) info = newInfo; @@ -123,12 +124,15 @@ Details are given in the following example. Note that above, we call ``Destructible.destroy()`` to "forward" the destruction request. The way this is done is problematic, as -seen in the following example:: +seen in the following example: - pragma solidity ^0.6.0; +.. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; contract owned { - constructor() public { owner = msg.sender; } + constructor() { owner = payable(msg.sender); } address payable owner; } @@ -152,12 +156,15 @@ seen in the following example:: A call to ``Final.destroy()`` will call ``Base2.destroy`` because we specify it explicitly in the final override, but this function will bypass -``Base1.destroy``. The way around this is to use ``super``:: +``Base1.destroy``. The way around this is to use ``super``: + +.. code-block:: solidity - pragma solidity >=0.4.22 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; contract owned { - constructor() public { owner = msg.sender; } + constructor() { owner = payable(msg.sender); } address payable owner; } @@ -191,31 +198,38 @@ not known in the context of the class where it is used, although its type is known. This is similar for ordinary virtual method lookup. -.. _function-overriding: - .. index:: ! overriding;function +.. _function-overriding: + Function Overriding =================== Base functions can be overridden by inheriting contracts to change their behavior if they are marked as ``virtual``. The overriding function must then -use the ``override`` keyword in the function header as shown in this example: +use the ``override`` keyword in the function header. +The overriding function may only change the visibility of the overridden function from ``external`` to ``public``. +The mutability may be changed to a more strict one following the order: +``nonpayable`` can be overridden by ``view`` and ``pure``. ``view`` can be overridden by ``pure``. +``payable`` is an exception and cannot be changed to any other mutability. -:: +The following example demonstrates changing mutability and visibility: - pragma solidity >=0.5.0 <0.7.0; +.. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; contract Base { - function foo() virtual public {} + function foo() virtual external view {} } contract Middle is Base {} contract Inherited is Middle { - function foo() public override {} + function foo() override public pure {} } For multiple inheritance, the most derived base contracts that define the same @@ -225,9 +239,10 @@ and have not yet been overridden by another base contract (on some path through Additionally, if a contract inherits the same function from multiple (unrelated) bases, it has to explicitly override it: -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.0 <0.9.0; contract Base1 { @@ -251,9 +266,10 @@ the function is defined in a common base contract or if there is a unique function in a common base contract that already overrides all other functions. -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.0 <0.9.0; contract A { function f() public pure{} } contract B is A {} @@ -287,17 +303,25 @@ contracts can no longer change the behaviour of that function. outside of interfaces. In interfaces, all functions are automatically considered ``virtual``. +.. note:: + + Starting from Solidity 0.8.8, the ``override`` keyword is not + required when overriding an interface function, except for the + case where the function is defined in multiple bases. + + Public state variables can override external functions if the parameter and return types of the function matches the getter function of the variable: -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.0 <0.9.0; contract A { - function f() external pure virtual returns(uint) { return 5; } + function f() external view virtual returns(uint) { return 5; } } contract B is A @@ -310,21 +334,22 @@ of the variable: While public state variables can override external functions, they themselves cannot be overridden. -.. _modifier-overriding: - .. index:: ! overriding;modifier +.. _modifier-overriding: + Modifier Overriding =================== Function modifiers can override each other. This works in the same way as -`function overriding `_ (except that there is no overloading for modifiers). The +:ref:`function overriding ` (except that there is no overloading for modifiers). The ``virtual`` keyword must be used on the overridden modifier and the ``override`` keyword must be used in the overriding modifier: -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.0 <0.9.0; contract Base { @@ -340,9 +365,10 @@ and the ``override`` keyword must be used in the overriding modifier: In case of multiple inheritance, all direct base contracts must be specified explicitly: -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.0 <0.9.0; contract Base1 { @@ -373,7 +399,7 @@ which is executed upon contract creation, and where you can run contract initialisation code. Before the constructor code is executed, state variables are initialised to -their specified value if you initialise them inline, or zero if you do not. +their specified value if you initialise them inline, or their :ref:`default value` if you do not. After the constructor has run, the final code of the contract is deployed to the blockchain. The deployment of @@ -383,62 +409,81 @@ and all functions that are reachable from there through function calls. It does not include the constructor code or internal functions that are only called from the constructor. -Constructor functions can be either ``public`` or ``internal``. If there is no +If there is no constructor, the contract will assume the default constructor, which is -equivalent to ``constructor() public {}``. For example: +equivalent to ``constructor() {}``. For example: -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; - contract A { + abstract contract A { uint public a; - constructor(uint _a) internal { - a = _a; + constructor(uint a_) { + a = a_; } } contract B is A(1) { - constructor() public {} + constructor() {} } -A constructor set as ``internal`` causes the contract to be marked as :ref:`abstract `. +You can use internal parameters in a constructor (for example storage pointers). In this case, +the contract has to be marked :ref:`abstract `, because these parameters +cannot be assigned valid values from outside but only through the constructors of derived contracts. .. 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 :: + 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 =============================== The constructors of all the base contracts will be called following the linearization rules explained below. If the base constructors have arguments, -derived contracts need to specify all of them. This can be done in two ways:: +derived contracts need to specify all of them. This can be done in two ways: - pragma solidity >=0.4.22 <0.7.0; +.. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; contract Base { uint x; - constructor(uint _x) public { x = _x; } + constructor(uint x_) { x = x_; } } // Either directly specify in the inheritance list... contract Derived1 is Base(7) { - constructor() public {} + 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) public {} + 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 describes it. The second way has to be used if the @@ -448,7 +493,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 @@ -476,9 +526,10 @@ stopping at the first match. If a base contract has already been searched, it is In the following code, Solidity will give the error "Linearization of inheritance graph impossible". -:: +.. code-block:: solidity - pragma solidity >=0.4.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.0 <0.9.0; contract X {} contract A is X {} @@ -496,16 +547,17 @@ C3 linearization is not too important in practice. One area where inheritance linearization is especially important and perhaps not as clear is when there are multiple constructors in the inheritance hierarchy. The constructors will always be executed in the linearized order, regardless of the order in which their arguments are provided in the inheriting contract's constructor. For example: -:: +.. code-block:: solidity - pragma solidity >=0.4.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; contract Base1 { - constructor() public {} + constructor() {} } contract Base2 { - constructor() public {} + constructor() {} } // Constructors are executed in the following order: @@ -513,7 +565,7 @@ One area where inheritance linearization is especially important and perhaps not // 2 - Base2 // 3 - Derived1 contract Derived1 is Base1, Base2 { - constructor() public Base1() Base2() {} + constructor() Base1() Base2() {} } // Constructors are executed in the following order: @@ -521,7 +573,7 @@ One area where inheritance linearization is especially important and perhaps not // 2 - Base1 // 3 - Derived2 contract Derived2 is Base2, Base1 { - constructor() public Base2() Base1() {} + constructor() Base2() Base1() {} } // Constructors are still executed in the following order: @@ -529,7 +581,7 @@ One area where inheritance linearization is especially important and perhaps not // 2 - Base1 // 3 - Derived3 contract Derived3 is Base2, Base1 { - constructor() public Base1() Base2() {} + constructor() Base1() Base2() {} } diff --git a/compiler/docs/contracts/interfaces.rst b/compiler/docs/contracts/interfaces.rst index 72780946..cc71cf64 100644 --- a/compiler/docs/contracts/interfaces.rst +++ b/compiler/docs/contracts/interfaces.rst @@ -6,12 +6,14 @@ Interfaces ********** -Interfaces are similar to abstract contracts, but they cannot have any functions implemented. There are further restrictions: +Interfaces are similar to abstract contracts, but they cannot have any functions implemented. +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. Some of these restrictions might be lifted in the future. @@ -20,9 +22,10 @@ an interface should be possible without any information loss. Interfaces are denoted by their own keyword: -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.2 <0.9.0; interface Token { enum TokenType { Fungible, NonFungible } @@ -32,17 +35,18 @@ Interfaces are denoted by their own keyword: Contracts can inherit interfaces as they would inherit other contracts. -All functions declared in interfaces are implicitly ``virtual``, which means that -they can be overridden. This does not automatically mean that an overriding function -can be overridden again - this is only possible if the overriding -function is marked ``virtual``. +All functions declared in interfaces are implicitly ``virtual`` and any +functions that override them do not need the ``override`` keyword. +This does not automatically mean that an overriding function can be overridden again - +this is only possible if the overriding function is marked ``virtual``. Interfaces can inherit from other interfaces. This has the same rules as normal inheritance. -:: +.. code-block:: solidity - pragma solidity >0.6.1 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.2 <0.9.0; interface ParentA { function test() external returns (uint256); diff --git a/compiler/docs/contracts/libraries.rst b/compiler/docs/contracts/libraries.rst index 803e53f0..7256ebe0 100644 --- a/compiler/docs/contracts/libraries.rst +++ b/compiler/docs/contracts/libraries.rst @@ -30,29 +30,38 @@ not possible to destroy a library. Libraries can be seen as implicit base contracts of the contracts that use them. They will not be explicitly visible in the inheritance hierarchy, but calls to library functions look just like calls to functions of explicit base -contracts (``L.f()`` if ``L`` is the name of the library). Furthermore, -``internal`` functions of libraries are visible in all contracts, just as -if the library were a base contract. Of course, calls to internal functions +contracts (using qualified access like ``L.f()``). +Of course, calls to internal functions use the internal calling convention, which means that all internal types can be passed and types :ref:`stored in memory ` will be passed by reference and not copied. -To realize this in the EVM, code of internal library functions +To realize this in the EVM, the code of internal library functions +that are called from a contract and all functions called from therein will at compile time be included in the calling contract, and a regular ``JUMP`` call will be used instead of a ``DELEGATECALL``. +.. note:: + The inheritance analogy breaks down when it comes to public functions. + Calling a public library function with ``L.f()`` results in an external call (``DELEGATECALL`` + to be precise). + In contrast, ``A.f()`` is an internal call when ``A`` is a base contract of the current contract. + .. index:: using for, set The following example illustrates how to use libraries (but using a manual method, be sure to check out :ref:`using for ` for a more advanced example to implement a set). -:: +.. code-block:: solidity - pragma solidity >=0.4.22 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.0 <0.9.0; // We define a new struct datatype that will be used to // hold its data in the calling contract. - struct Data { mapping(uint => bool) flags; } + struct Data { + mapping(uint => bool) flags; + } library Set { // Note that the first parameter is of type "storage @@ -121,9 +130,11 @@ The following example shows how to use :ref:`types stored in memory =0.4.16 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.0; struct bigint { uint[] limbs; @@ -135,17 +146,20 @@ 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); - r.limbs[i] = a + b + carry; - if (a + b < a || (a + b == uint(-1) && carry > 0)) - carry = 1; - else - carry = 0; + uint limbA = limb(a, i); + uint limbB = limb(b, i); + unchecked { + r.limbs[i] = limbA + limbB + carry; + + if (limbA + limbB < limbA || (limbA + limbB == type(uint).max && carry > 0)) + carry = 1; + else + carry = 0; + } } if (carry > 0) { // too bad, we have to add a limb @@ -158,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) { @@ -172,7 +186,7 @@ custom types without the overhead of external function calls: function f() public pure { bigint memory x = BigInt.fromUint(7); - bigint memory y = BigInt.fromUint(uint(-1)); + bigint memory y = BigInt.fromUint(type(uint).max); bigint memory z = x.add(y); assert(z.limb(1) > 0); } @@ -181,24 +195,15 @@ custom types without the overhead of external function calls: It is possible to obtain the address of a library by converting the library type to the ``address`` type, i.e. using ``address(LibraryName)``. -As the compiler cannot know where the library will be -deployed at, these addresses have to be filled into the -final bytecode by a linker -(see :ref:`commandline-compiler` for how to use the -commandline compiler for linking). If the addresses are not -given as arguments to the compiler, the compiled hex code -will contain placeholders of the form ``__Set______`` (where -``Set`` is the name of the library). The address can be filled -manually by replacing all those 40 symbols by the hex -encoding of the address of the library contract. - -.. note:: - Manually linking libraries on the generated bytecode is discouraged, because - in this way, the library name is restricted to 36 characters. - You should ask the compiler to link the libraries at the time - a contract is compiled by either using - the ``--libraries`` option of ``solc`` or the ``libraries`` key if you use - the standard-JSON interface to the compiler. +As the compiler does not know the address where the library will be deployed, the compiled hex code +will contain placeholders of the form ``__$30bbc0abd4d6364515865950d3e0d10953$__``. The placeholder +is a 34 character prefix of the hex encoding of the keccak256 hash of the fully qualified library +name, which would be for example ``libraries/bigint.sol:BigInt`` if the library was stored in a file +called ``bigint.sol`` in a ``libraries/`` directory. Such bytecode is incomplete and should not be +deployed. Placeholders need to be replaced with actual addresses. You can do that by either passing +them to the compiler when the library is being compiled or by using the linker to update an already +compiled binary. See :ref:`library-linking` for information on how to use the commandline compiler +for linking. In comparison to contracts, libraries are restricted in the following ways: @@ -210,6 +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; of a library function Function Signatures and Selectors in Libraries ============================================== @@ -222,12 +228,14 @@ following an internal naming schema and arguments of types not supported in the The following identifiers are used for the types in the signatures: - - Value types, non-storage ``string`` and non-storage ``bytes`` use the same identifiers as in the contract ABI. - - Non-storage array types follow the same convention as in the contract ABI, i.e. ``[]`` for dynamic arrays and - ``[M]`` for fixed-size arrays of ``M`` elements. - - Non-storage structs are referred to by their fully qualified name, i.e. ``C.S`` for ``contract C { struct S { ... } }``. - - Storage pointer types use the type identifier of their corresponding non-storage type, but append a single space - followed by ``storage`` to it. +- Value types, non-storage ``string`` and non-storage ``bytes`` use the same identifiers as in the contract ABI. +- Non-storage array types follow the same convention as in the contract ABI, i.e. ``[]`` for dynamic arrays and + ``[M]`` for fixed-size arrays of ``M`` elements. +- Non-storage structs are referred to by their fully qualified name, i.e. ``C.S`` for ``contract C { struct S { ... } }``. +- Storage pointer mappings use ``mapping( => ) storage`` where ```` and ```` are + the identifiers for the key and value types of the mapping, respectively. +- Other storage pointer types use the type identifier of their corresponding non-storage type, but append a single space + followed by ``storage`` to it. The argument encoding is the same as for the regular contract ABI, except for storage pointers, which are encoded as a ``uint256`` value referring to the storage slot to which they point. @@ -235,9 +243,10 @@ The argument encoding is the same as for the regular contract ABI, except for st Similarly to the contract ABI, the selector consists of the first four bytes of the Keccak256-hash of the signature. Its value can be obtained from Solidity using the ``.selector`` member as follows: -:: +.. code-block:: solidity - pragma solidity >0.5.13 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.5.14 <0.9.0; library L { function f(uint256) external {} @@ -279,4 +288,4 @@ for any non-view and non-pure function. This means that the actual code stored on chain for a library is different from the code reported by the compiler as -``deployedBytecode``. \ No newline at end of file +``deployedBytecode``. diff --git a/compiler/docs/contracts/using-for.rst b/compiler/docs/contracts/using-for.rst index 32aa7179..b4a60585 100644 --- a/compiler/docs/contracts/using-for.rst +++ b/compiler/docs/contracts/using-for.rst @@ -6,68 +6,95 @@ 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. +The directive ``using A for B;`` can be used to attach +functions (``A``) as member functions to any type (``B``). These functions will receive the object they are called on as their first parameter (like the ``self`` variable in Python). -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 file-level or library functions (``using {f, g, h, L.t} for uint;``) - + only those functions will be attached to the type. +- the name of a library (``using L for uint;``) - + all functions (both public and internal ones) of the library are attached to the type + +At file level, the second part, ``B``, has to be an explicit type (without data location specifier). +Inside contracts, you can also use ``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* functions in the library are 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 (``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. + 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 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. - pragma solidity >=0.4.16 <0.7.0; +.. code-block:: solidity + // SPDX-License-Identifier: GPL-3.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; + + function insert(Data storage self, uint value) + returns (bool) + { + if (self.flags[value]) + return false; // already there + self.flags[value] = true; + return true; + } - 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 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 { @@ -79,9 +106,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 - pragma solidity >=0.4.16 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.13; library Search { function indexOf(uint[] storage self, uint value) @@ -91,30 +122,30 @@ It is also possible to extend elementary types in that way:: { for (uint i = 0; i < self.length; i++) if (self[i] == value) return i; - return uint(-1); + 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); - if (index == uint(-1)) - data.push(_new); + uint index = data.indexOf(from); + if (index == type(uint).max) + 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. diff --git a/compiler/docs/contracts/visibility-and-getters.rst b/compiler/docs/contracts/visibility-and-getters.rst index 3a090515..8932c507 100644 --- a/compiler/docs/contracts/visibility-and-getters.rst +++ b/compiler/docs/contracts/visibility-and-getters.rst @@ -1,60 +1,72 @@ .. index:: ! visibility, external, public, private, internal +.. |visibility-caveat| replace:: Making something ``private`` or ``internal`` only prevents other contracts from reading or modifying the information, but it will still be visible to the whole world outside of the blockchain. + .. _visibility-and-getters: ********************** Visibility and Getters ********************** -Solidity knows two kinds of function calls: internal -ones that do not create an actual EVM call (also called -a "message call") and external -ones that do. Because of that, there are four types of visibility for -functions and state variables. +State Variable Visibility +========================= + +``public`` + Public state variables differ from internal ones only in that the compiler automatically generates + :ref:`getter functions` for them, which allows other contracts to read their values. + When used within the same contract, the external access (e.g. ``this.x``) invokes the getter + while internal access (e.g. ``x``) gets the variable value directly from storage. + Setter functions are not generated so other contracts cannot directly modify their values. + +``internal`` + Internal state variables can only be accessed from within the contract they are defined in + and in derived contracts. + They cannot be accessed externally. + This is the default visibility level for state variables. + +``private`` + Private state variables are like internal ones but they are not visible in derived contracts. + +.. warning:: + |visibility-caveat| -Functions have to be specified as being ``external``, -``public``, ``internal`` or ``private``. -For state variables, ``external`` is not possible. +Function Visibility +=================== -``external``: +Solidity knows two kinds of function calls: external ones that do create an actual EVM message call and internal ones that do not. +Furthermore, internal functions can be made inaccessible to derived contracts. +This gives rise to four types of visibility for functions. + +``external`` External functions are part of the contract interface, which means they can be called from other contracts and via transactions. An external function ``f`` cannot be called internally (i.e. ``f()`` does not work, but ``this.f()`` works). - External functions are sometimes more efficient when - they receive large arrays of data, because the data - is not copied from calldata to memory. -``public``: +``public`` Public functions are part of the contract interface - and can be either called internally or via - messages. For public state variables, an automatic getter - function (see below) is generated. - -``internal``: - Those functions and state variables can only be - accessed internally (i.e. from within the current contract - or contracts deriving from it), without using ``this``. - -``private``: - Private functions and state variables are only - visible for the contract they are defined in and not in - derived contracts. - -.. note:: - Everything that is inside a contract is visible to - all observers external to the blockchain. Making something ``private`` - only prevents other contracts from reading or modifying - the information, but it will still be visible to the - whole world outside of the blockchain. + and can be either called internally or via message calls. + +``internal`` + Internal functions can only be accessed from within the current contract + or contracts deriving from it. + They cannot be accessed externally. + Since they are not exposed to the outside through the contract's ABI, they can take parameters of internal types like mappings or storage references. + +``private`` + Private functions are like internal ones but they are not visible in derived contracts. + +.. warning:: + |visibility-caveat| The visibility specifier is given after the type for state variables and between parameter list and return parameter list for functions. -:: +.. code-block:: solidity - pragma solidity >=0.4.16 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.16 <0.9.0; contract C { function f(uint a) private pure returns (uint b) { return a + 1; } @@ -66,9 +78,10 @@ In the following example, ``D``, can call ``c.getData()`` to retrieve the value ``data`` in state storage, but is not able to call ``f``. Contract ``E`` is derived from ``C`` and, thus, can call ``compute``. -:: +.. code-block:: solidity - pragma solidity >=0.4.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.16 <0.9.0; contract C { uint private data; @@ -110,9 +123,10 @@ arguments and returns a ``uint``, the value of the state variable ``data``. State variables can be initialized when they are declared. -:: +.. code-block:: solidity - pragma solidity >=0.4.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.16 <0.9.0; contract C { uint public data = 42; @@ -130,9 +144,10 @@ symbol is accessed internally (i.e. without ``this.``), it evaluates to a state variable. If it is accessed externally (i.e. with ``this.``), it evaluates to a function. -:: +.. code-block:: solidity - pragma solidity >=0.4.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.0 <0.9.0; contract C { uint public data; @@ -146,12 +161,13 @@ If you have a ``public`` state variable of array type, then you can only retriev single elements of the array via the generated getter function. This mechanism exists to avoid high gas costs when returning an entire array. You can use arguments to specify which individual element to return, for example -``data(0)``. If you want to return an entire array in one call, then you need +``myArray(0)``. If you want to return an entire array in one call, then you need to write a function, for example: -:: +.. code-block:: solidity - pragma solidity >=0.4.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.16 <0.9.0; contract arrayExample { // public state variable @@ -175,25 +191,34 @@ Now you can use ``getArray()`` to retrieve the entire array, instead of The next example is more complex: -:: +.. code-block:: solidity - pragma solidity >=0.4.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.0 <0.9.0; contract Complex { struct Data { uint a; bytes3 b; mapping (uint => uint) map; + uint[3] c; + uint[] d; + bytes e; } mapping (uint => mapping(bool => Data[])) public data; } -It generates a function of the following form. The mapping in the struct is omitted -because there is no good way to provide the key for the mapping: +It generates a function of the following form. The mapping and arrays (with the +exception of byte arrays) in the struct are omitted because there is no good way +to select individual struct members or provide a key for the mapping: -:: +.. code-block:: solidity - function data(uint arg1, bool arg2, uint arg3) public returns (uint a, bytes3 b) { + function data(uint arg1, bool arg2, uint arg3) + public + returns (uint a, bytes3 b, bytes memory e) + { a = data[arg1][arg2][arg3].a; b = data[arg1][arg2][arg3].b; + e = data[arg1][arg2][arg3].e; } diff --git a/compiler/docs/contributing.rst b/compiler/docs/contributing.rst index dbfcebe8..9da7f02d 100644 --- a/compiler/docs/contributing.rst +++ b/compiler/docs/contributing.rst @@ -2,24 +2,27 @@ Contributing ############ -Help is always appreciated! +Help is always welcome and there are plenty of options to contribute to Solidity. -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. +In particular, we appreciate support in the following areas: -In particular, we need help in the following areas: - -* Improving the documentation -* Responding to questions from other users on `StackExchange - `_ and the `Solidity Gitter - `_ +* Reporting issues. * Fixing and responding to `Solidity's GitHub issues `_, especially those tagged as - `good first issue `_ which are + `"good first issue" `_ which are meant as introductory issues for external contributors. +* Improving the documentation. +* Translating the documentation into more languages. +* Responding to questions from other users on `StackExchange + `_ and the `Solidity Gitter Chat + `_. +* Getting involved in the language design process by proposing language changes or new features in the `Solidity forum `_ and providing feedback. -Please note that this project is released with a `Contributor Code of Conduct `_. By participating in this project - in the issues, pull requests, or Gitter channels - you agree to abide by its terms. +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 `_. By participating in this project — in the issues, pull requests, or Gitter channels — you agree to abide by its terms. Team Calls ========== @@ -27,10 +30,9 @@ 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: -- Monday at 12pm CET -- Wednesday at 3pm CET +- Mondays and Wednesdays at 3pm CET/CEST. -Both calls take place on `Google Hangouts `_. +Both calls take place on `Jitsi `_. How to Report Issues ==================== @@ -39,15 +41,14 @@ To report an issue, please use the `GitHub issues tracker `_. When reporting issues, please mention the following details: -* Which version of Solidity you are using -* What was the source code (if applicable) -* Which platform are you running on -* How to reproduce the issue -* What was the result of the issue -* What the expected behaviour is +* Solidity version. +* Source code (if applicable). +* Operating system. +* Steps to reproduce the issue. +* Actual vs. expected behaviour. 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. Workflow for Pull Requests ========================== @@ -65,8 +66,8 @@ 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 -`_ (different from the one mentioned above, this one is -focused on compiler and language development instead of language use) first. +`_ (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 follow the style of previous entries, when applicable. @@ -78,68 +79,108 @@ ensure that it builds locally before submitting a pull request. Thank you for your help! -Running the compiler tests +Running the Compiler Tests ========================== -The ``./scripts/tests.sh`` script executes most Solidity tests automatically, -but for quicker feedback, you might want to run specific tests. +Prerequisites +------------- + +For running all compiler tests you may want to optionally install a few +dependencies (`evmone `_, +`libz3 `_, and +`libhera `_). + +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, +otherwise several tests may fail. +Administrators should have that privilege, but you may also +`grant it to other users `_ +or +`enable Developer Mode `_. + +Running the Tests +----------------- Solidity includes different types of tests, most of them bundled into the -`Boost C++ Test Framework `_ application ``soltest``. +`Boost C++ Test Framework `_ application ``soltest``. Running ``build/test/soltest`` or its wrapper ``scripts/soltest.sh`` is sufficient for most changes. -Some tests require the ``evmone`` library, others require ``libz3``. +The ``./scripts/tests.sh`` script executes most Solidity tests automatically, +including those bundled into the `Boost C++ Test Framework `_ +application ``soltest`` (or its wrapper ``scripts/soltest.sh``), as well as command line tests and +compilation tests. -The test system will automatically try to discover the location of the ``evmone`` library -starting from the current directory. The required file is called ``libevmone.so`` on Linux systems, -``evmone.dll`` on Windows systems and ``libevmone.dylib`` on MacOS. If it is not found, the relevant tests -are skipped. To run all tests, download the library from -`Github `_ -and either place it in the project root path or inside the ``deps`` folder. +The test system automatically tries to discover the location of +the `evmone `_ for running the semantic tests. -If you do not have libz3 installed on your system, you should disable the SMT tests: -``./scripts/soltest.sh --no-smt``. +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 +for the ``evmone`` shared object can be specified via the ``ETH_EVMONE`` environment variable. -``./build/test/soltest --help`` has extensive help on all of the options available. -See especially: +``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 `_ +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 +extension ``.so`` on Linux, ``.dll`` on Windows systems and ``.dylib`` on macOS. -- `show_progress (-p) `_ to show test completion, -- `run_test (-t) `_ to run specific tests cases, and -- `report-level (-r) `_ give a more detailed report. +For running SMT tests, the ``libz3`` library must be installed and locatable +by ``cmake`` during compiler configure stage. + +If the ``libz3`` library is not installed on your system, you should disable the +SMT tests by exporting ``SMT_FLAGS=--no-smt`` before running ``./scripts/tests.sh`` or +running ``./scripts/soltest.sh --no-smt``. +These tests are ``libsolidity/smtCheckerTests`` and ``libsolidity/smtCheckerTestsJSON``. .. note :: - Those working in a Windows environment wanting to run the above basic sets without libz3 in Git Bash, you would have to do: ``./build/test/Release/soltest.exe -- --no-smt``. - If you are running this in plain Command Prompt, use ``.\build\test\Release\soltest.exe -- --no-smt``. + To get a list of all unit tests run by Soltest, run ``./build/test/soltest --list_content=HRF``. + +For quicker results you can run a subset of, or specific tests. To run a subset of tests, you can use filters: ``./scripts/soltest.sh -t TestSuite/TestName``, where ``TestName`` can be a wildcard ``*``. -For example, here is an example test you might run; +Or, for example, to run all the tests for the yul disambiguator: ``./scripts/soltest.sh -t "yulOptimizerTests/disambiguator/*" --no-smt``. -This will test all the tests for the disambiguator. -To get a list of all tests, use -``./build/test/soltest --list_content=HRF``. +``./build/test/soltest --help`` has extensive help on all of the options available. + +See especially: + +- `show_progress (-p) `_ to show test completion, +- `run_test (-t) `_ to run specific tests cases, and +- `report-level (-r) `_ give a more detailed report. + +.. 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``. + If you are running this in plain Command Prompt, use ``.\build\test\Release\soltest.exe -- --no-smt``. 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 .. make -This will create symbols such that when you debug a test using the ``--debug`` flag, you will have access to functions and variables in which you can break or print with. - - -The script ``./scripts/tests.sh`` also runs commandline tests and compilation tests -in addition to those found in ``soltest``. +This creates symbols so that when you debug a test using the ``--debug`` flag, +you have access to functions and variables in which you can break or print with. -The CI runs additional tests (including ``solc-js`` and testing third party Solidity frameworks) that require compiling the Emscripten target. +The CI runs additional tests (including ``solc-js`` and testing third party Solidity +frameworks) that require compiling the Emscripten target. - -Writing and running syntax tests +Writing and Running Syntax Tests -------------------------------- Syntax tests check that the compiler generates the correct error messages for invalid code @@ -150,7 +191,7 @@ The test suite compiles and checks them against the given expectations. For example: ``./test/libsolidity/syntaxTests/double_stateVariable_declaration.sol`` -:: +.. code-block:: solidity contract test { uint256 variable; @@ -169,7 +210,7 @@ In the above example, the state variable ``variable`` was declared twice, which The ``isoltest`` tool is used for these tests and you can find it under ``./build/test/tools/``. It is an interactive tool which allows editing of failing contracts using your preferred text editor. Let's try to break this test by removing the second declaration of ``variable``: -:: +.. code-block:: solidity contract test { uint256 variable; @@ -177,9 +218,9 @@ editing of failing contracts using your preferred text editor. Let's try to brea // ---- // DeclarationError: (36-52): Identifier already declared. -Running ``./build/test/isoltest`` again results in a test failure: +Running ``./build/test/tools/isoltest`` again results in a test failure: -:: +.. code-block:: text syntaxTests/double_stateVariable_declaration.sol: FAIL Contract: @@ -203,11 +244,11 @@ It offers several options for failing tests: - ``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 -:: +.. code-block:: solidity contract test { uint256 variable; @@ -216,7 +257,7 @@ Automatically updating the test above changes it to and re-run the test. It now passes again: -:: +.. code-block:: text Re-running test case... syntaxTests/double_stateVariable_declaration.sol: OK @@ -238,11 +279,11 @@ inside the input. We have a specialized binary called ``solfuzzer`` which takes and fails whenever it encounters an internal compiler error, segmentation fault or similar, but does not fail if e.g., the code contains an error. This way, fuzzing tools can find internal problems in the compiler. -We mainly use `AFL `_ for fuzzing. You need to download and +We mainly use `AFL `_ for fuzzing. You need to download and install the AFL packages from your repositories (afl, afl-clang) or build them manually. Next, build Solidity (or just the ``solfuzzer`` binary) with AFL as your compiler: -:: +.. code-block:: bash cd build # if needed @@ -250,9 +291,9 @@ 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 Scanning dependencies of target solfuzzer [ 98%] Building CXX object test/tools/CMakeFiles/solfuzzer.dir/fuzzer.cpp.o @@ -263,7 +304,7 @@ At this stage you should be able to see a message similar to the following: If the instrumentation messages did not appear, try switching the cmake flags pointing to AFL's clang binaries: -:: +.. code-block:: bash # if previously failed make clean @@ -272,7 +313,7 @@ If the instrumentation messages did not appear, try switching the cmake flags po Otherwise, upon execution the fuzzer halts with an error saying binary is not instrumented: -:: +.. code-block:: text afl-fuzz 2.52b by ... (truncated messages) @@ -296,14 +337,14 @@ Next, you need some example source files. This makes it much easier for the fuzz to find errors. You can either copy some files from the syntax tests or extract test files from the documentation or the other tests: -:: +.. code-block:: bash mkdir /tmp/test_cases cd /tmp/test_cases # extract from tests: path/to/solidity/scripts/isolate_tests.py path/to/solidity/test/libsolidity/SolidityEndToEndTest.cpp # extract from documentation: - path/to/solidity/scripts/isolate_tests.py path/to/solidity/docs docs + path/to/solidity/scripts/isolate_tests.py path/to/solidity/docs The AFL documentation states that the corpus (the initial input files) should not be too large. The files themselves should not be larger than 1 kB and there should be @@ -313,7 +354,7 @@ that result in similar behaviour of the binary. Now run the fuzzer (the ``-m`` extends the size of memory to 60 MB): -:: +.. code-block:: bash afl-fuzz -m 60 -i /tmp/test_cases -o /tmp/fuzzer_reports -- /path/to/solfuzzer @@ -340,12 +381,17 @@ by as many concatenations of its contents as there were sets of variables suppli each time replacing any ```` items by their respective value. Top-level variables can also be used inside such areas. +There are also conditionals of the form ``......``, where template replacements +continue recursively either in the first or the second segment depending on the value of the boolean +parameter ``name``. If ``......`` is used, then the check is whether +the string parameter ``name`` is non-empty. + .. _documentation-style: Documentation Style Guide ========================= -The following are style recommendations specifically for documentation +In the following section you find style recommendations specifically focusing on documentation contributions to Solidity. English Language @@ -362,21 +408,22 @@ local slang and references, making your language as clear to all readers as poss .. note:: While the official Solidity documentation is written in English, there are community contributed :ref:`translations` - in other languages available. + in other languages available. Please refer to the `translation guide `_ + for information on how to contribute to the community translations. Title Case for Headings ----------------------- -Use `title case `_ for headings. This means capitalise all principal words in +Use `title case `_ for headings. This means capitalise all principal words in titles, but not articles, conjunctions, and prepositions unless they start the title. For example, the following are all correct: -* Title Case for Headings -* For Headings Use Title Case -* Local and State Variable Names -* Order of Layout +* Title Case for Headings. +* For Headings Use Title Case. +* Local and State Variable Names. +* Order of Layout. Expand Contractions ------------------- @@ -422,10 +469,37 @@ or ``interface`` using the ``./test/cmdlineTests.sh`` script when you create a P ensure they work and pass tests before creating the PR. Ensure that all code examples begin with a ``pragma`` version that spans the largest where the contract code is valid. -For example ``pragma solidity >=0.4.0 <0.7.0;``. +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 +======================== + +To actively get involved in the language design process and to share your ideas concerning the future of Solidity, +please join the `Solidity forum `_. + +The Solidity forum serves as the place to propose and discuss new language features and their implementation in +the early stages of ideation or modifications of existing features. + +As soon as proposals get more tangible, their +implementation will also be discussed in the `Solidity GitHub repository `_ +in the form of issues. + +In addition to the forum and issue discussions, we regularly host language design discussion calls in which selected +topics, issues or feature implementations are debated in detail. The invitation to those calls is shared via the forum. + +We are also sharing feedback surveys and other content that is relevant to language design in the forum. + +If you want to know where the team is standing in terms or implementing new features, you can follow the implementation status in the `Solidity Github project `_. +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 `_. + +For ad-hoc cases and questions, you can reach out to us via the `Solidity-dev Gitter channel `_ — 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. diff --git a/compiler/docs/control-structures.rst b/compiler/docs/control-structures.rst index 248641e3..18a52221 100644 --- a/compiler/docs/control-structures.rst +++ b/compiler/docs/control-structures.rst @@ -17,9 +17,9 @@ the usual semantics known from C or JavaScript. Solidity also supports exception handling in the form of ``try``/``catch``-statements, but only for :ref:`external function calls ` and -contract creation calls. +contract creation calls. Errors can be created using the :ref:`revert statement `. -Parentheses can *not* be omitted for conditionals, but curly brances can be omitted +Parentheses can *not* be omitted for conditionals, but curly braces can be omitted around single-statement bodies. Note that there is no type conversion from non-boolean to boolean types as @@ -39,10 +39,14 @@ Internal Function Calls ----------------------- Functions of the current contract can be called directly ("internally"), also recursively, as seen in -this nonsensical example:: +this nonsensical example: - pragma solidity >=0.4.16 <0.7.0; +.. code-block:: solidity + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.22 <0.9.0; + + // This will report a warning contract C { function g(uint a) public pure returns (uint ret) { return a + f(); } function f() internal pure returns (uint ret) { return g(7) + f(); } @@ -61,9 +65,10 @@ uses up at least one stack slot and there are only 1024 slots available. External Function Calls ----------------------- -The expressions ``this.g(8);`` and ``c.g(2);`` (where ``c`` is a contract -instance) are also valid function calls, but this time, the function -will be called "externally", via a message call and not directly via jumps. +Functions can also be called using the ``this.g(8);`` and ``c.g(2);`` notation, where +``c`` is a contract instance and ``g`` is a function belonging to ``c``. +Calling the function ``g`` via either way results in it being called "externally", using a +message call and not directly via jumps. Please note that function calls on ``this`` cannot be used in the constructor, as the actual contract has not been created yet. @@ -80,9 +85,10 @@ Note that it is discouraged to specify gas values explicitly, since the gas cost of opcodes can change in the future. Any Wei you send to the contract is added to the total balance of that contract: -:: +.. code-block:: solidity - pragma solidity >=0.4.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.2 <0.9.0; contract InfoFeed { function info() public payable returns (uint ret) { return 42; } @@ -100,11 +106,28 @@ otherwise, the ``value`` option would not be available. .. warning:: Be careful that ``feed.info{value: 10, gas: 800}`` only locally sets the ``value`` and amount of ``gas`` sent with the function call, and the - parentheses at the end perform the actual call. So in this case, the - function is not called and the ``value`` and ``gas`` settings are lost. + parentheses at the end perform the actual call. So + ``feed.info{value: 10, gas: 800}`` does not call the function and + the ``value`` and ``gas`` settings are lost, only + ``feed.info{value: 10, gas: 800}()`` performs the function call. + +Due to the fact that the EVM considers a call to a non-existing contract to +always succeed, Solidity uses the ``extcodesize`` opcode to check that +the contract that is about to be called actually exists (it contains code) +and causes an exception if it does not. This check is skipped if the return +data will be decoded after the call and thus the ABI decoder will catch the +case of a non-existing contract. + +Note that this check is not performed in case of :ref:`low-level calls ` which +operate on addresses rather than contract instances. + +.. note:: + Be careful when using high-level calls to + :ref:`precompiled contracts `, + since the compiler considers them non-existing according to the + above logic even though they execute code and can return data. -Function calls cause exceptions if the called contract does not exist (in the -sense that the account does not contain code) or if the called contract itself +Function calls also cause exceptions if the called contract itself throws an exception or goes out of gas. .. warning:: @@ -123,21 +146,22 @@ throws an exception or goes out of gas. so your contract is not vulnerable to a reentrancy exploit. .. note:: - Before Solidity 0.6.2, the recommended way to specify the value and gas - was to use ``f.value(x).gas(g)()``. This is still possible but deprecated - and will be removed with Solidity 0.7.0. + Before Solidity 0.6.2, the recommended way to specify the value and gas was to + 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 example. The argument list has to coincide by name with the list of parameters from the function declaration, but can be in arbitrary order. -:: +.. code-block:: solidity - pragma solidity >=0.4.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.0 <0.9.0; contract C { mapping(uint => uint) data; @@ -152,15 +176,18 @@ parameters from the function declaration, but can be in arbitrary order. } -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 - pragma solidity >=0.4.16 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.22 <0.9.0; contract C { // omitted name for parameter @@ -181,13 +208,13 @@ A contract can create other contracts using the ``new`` keyword. The full code of the contract being created has to be known when the creating contract is compiled so recursive creation-dependencies are not possible. -:: - - pragma solidity >=0.5.0 <0.7.0; +.. code-block:: solidity + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; contract D { uint public x; - constructor(uint a) public payable { + constructor(uint a) payable { x = a; } } @@ -236,31 +263,31 @@ contracts creates other contracts in the meantime. The main use-case here is contracts that act as judges for off-chain interactions, which only need to be created if there is a dispute. -:: - - pragma solidity >0.6.1 <0.7.0; +.. code-block:: solidity + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; contract D { uint public x; - constructor(uint a) public { + constructor(uint a) { x = a; } } contract C { function createDSalted(bytes32 salt, uint arg) public { - /// This complicated expression just tells you how the address - /// can be pre-computed. It is just there for illustration. - /// You actually only need ``new D{salt: salt}(arg)``. - address predictedAddress = address(bytes20(keccak256(abi.encodePacked( - byte(0xff), + // This complicated expression just tells you how the address + // can be pre-computed. It is just there for illustration. + // You actually only need ``new D{salt: salt}(arg)``. + address predictedAddress = address(uint160(uint(keccak256(abi.encodePacked( + bytes1(0xff), address(this), salt, keccak256(abi.encodePacked( type(D).creationCode, - arg + abi.encode(arg) )) - )))); + ))))); D d = new D{salt: salt}(arg); require(address(d) == predictedAddress); @@ -272,7 +299,7 @@ which only need to be created if there is a dispute. re-created at the same address after having been destroyed. Yet, it is possible for that newly created contract to have a different deployed bytecode even though the creation bytecode has been the same (which is a requirement because - otherwise the address would change). This is due to the fact that the compiler + otherwise the address would change). This is due to the fact that the constructor can query external state that might have changed between the two creations and incorporate that into the deployed bytecode before it is stored. @@ -305,9 +332,10 @@ or to pre-existing variables (or LValues in general). Tuples are not proper types in Solidity, they can only be used to form syntactic groupings of expressions. -:: +.. code-block:: solidity - pragma solidity >0.4.23 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.5.0 <0.9.0; contract C { uint index; @@ -343,26 +371,17 @@ i.e. the following is not valid: ``(x, uint y) = (1, 2);`` Complications for Arrays and Structs ------------------------------------ -The semantics of assignments are a bit more complicated for -non-value types like arrays and structs. -Assigning *to* a state variable always creates an independent -copy. On the other hand, assigning to a local variable creates -an independent copy only for elementary types, i.e. static -types that fit into 32 bytes. If structs or arrays (including -``bytes`` and ``string``) are assigned from a state variable -to a local variable, the local variable holds a reference to -the original state variable. A second assignment to the local -variable does not modify the state but only changes the -reference. Assignments to members (or elements) of the local -variable *do* change the state. +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 ` 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`` because only a reference and not a copy is passed. -:: +.. code-block:: solidity - pragma solidity >=0.4.16 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.22 <0.9.0; contract C { uint[20] x; @@ -418,9 +437,10 @@ use state variables before they are declared and call functions recursively. As a consequence, the following examples will compile without warnings, since the two variables have the same name but disjoint scopes. -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.5.0 <0.9.0; contract C { function minimalScoping() pure public { { @@ -439,9 +459,10 @@ As a special example of the C99 scoping rules, note that in the following, the first assignment to ``x`` will actually assign the outer and not the inner variable. In any case, you will get a warning about the outer variable being shadowed. -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.5.0 <0.9.0; // This will report a warning contract C { function f() pure public returns (uint) { @@ -460,9 +481,10 @@ In any case, you will get a warning about the outer variable being shadowed. for the entire function, regardless where it was declared. The following example shows a code snippet that used to compile but leads to an error starting from version 0.5.0. -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.5.0 <0.9.0; // This will not compile contract C { function f() pure public returns (uint) { @@ -472,6 +494,76 @@ In any case, you will get a warning about the outer variable being shadowed. } } + +.. index:: ! safe math, safemath, checked, unchecked +.. _unchecked: + +Checked or Unchecked Arithmetic +=============================== + +An overflow or underflow is the situation where the resulting value of an arithmetic operation, +when executed on an unrestricted integer, falls outside the range of the result type. + +Prior to Solidity 0.8.0, arithmetic operations would always wrap in case of +under- or overflow leading to widespread use of libraries that introduce +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: + +.. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.0; + contract C { + function f(uint a, uint b) pure public returns (uint) { + // This subtraction will wrap on underflow. + unchecked { return a - b; } + } + function g(uint a, uint b) pure public returns (uint) { + // This subtraction will revert on underflow. + return a - b; + } + } + +The call to ``f(2, 3)`` will return ``2**256-1``, while ``g(2, 3)`` will cause +a failing assertion. + +The ``unchecked`` block can be used everywhere inside a block, but not as a replacement +for a block. It also cannot be nested. + +The setting only affects the statements that are syntactically inside the block. +Functions called from within an ``unchecked`` block do not inherit the property. + +.. note:: + To avoid ambiguity, you cannot use ``_;`` inside an ``unchecked`` block. + +The following operators will cause a failing assertion on overflow or underflow +and will wrap without an error if used inside an unchecked block: + +``++``, ``--``, ``+``, binary ``-``, unary ``-``, ``*``, ``/``, ``%``, ``**`` + +``+=``, ``-=``, ``*=``, ``/=``, ``%=`` + +.. warning:: + It is not possible to disable the check for division by zero + or modulo by zero using the ``unchecked`` block. + +.. note:: + Bitwise operators do not perform overflow or underflow checks. + This is particularly visible when using bitwise shifts (``<<``, ``>>``, ``<<=``, ``>>=``) in + place of integer division and multiplication by a power of 2. + For example ``type(uint256).max << 3`` does not revert even though ``type(uint256).max * 8`` would. + +.. note:: + The second statement in ``int x = type(int).min; -x;`` will result in an overflow + because the negative range can hold one more value than the positive range. + +Explicit type conversions will always truncate and never cause a failing assertion +with the exception of a conversion from an integer to an enum type. + .. index:: ! exception, ! throw, ! assert, ! require, ! revert, ! errors .. _assert-and-require: @@ -485,7 +577,8 @@ state in the current call (and all its sub-calls) and flags an error to the caller. When exceptions happen in a sub-call, they "bubble up" (i.e., -exceptions are rethrown) automatically. Exceptions to this rule are ``send`` +exceptions are rethrown) automatically unless they are caught in +a ``try/catch`` statement. Exceptions to this rule are ``send`` and the low-level functions ``call``, ``delegatecall`` and ``staticcall``: they return ``false`` as their first return value in case of an exception instead of "bubbling up". @@ -496,39 +589,71 @@ of an exception instead of "bubbling up". if the account called is non-existent, as part of the design of the EVM. Account existence must be checked prior to calling if needed. -Exceptions can be caught with the ``try``/``catch`` statement. +Exceptions can contain error data that is passed back to the caller +in the form of :ref:`error instances `. +The built-in errors ``Error(string)`` and ``Panic(uint256)`` are +used by special functions, as explained below. ``Error`` is used for "regular" error conditions +while ``Panic`` is used for errors that should not be present in bug-free code. -``assert`` and ``require`` --------------------------- +Panic via ``assert`` and Error via ``require`` +---------------------------------------------- The convenience functions ``assert`` and ``require`` can be used to check for conditions and throw an exception if the condition is not met. -The ``assert`` function should only be used to test for internal +The ``assert`` function creates an error of type ``Panic(uint256)``. +The same error is created by the compiler in certain situations as listed below. + +Assert should only be used to test for internal errors, and to check invariants. Properly functioning code should -never reach a failing ``assert`` statement; if this happens there +never create a Panic, not even on invalid external input. +If this happens, then there is a bug in your contract which you should fix. Language analysis tools can evaluate your contract to identify the conditions and -function calls which will reach a failing ``assert``. - -An ``assert``-style exception is generated in the following situations: - -#. If you access an array or an array slice at a too large or negative index (i.e. ``x[i]`` where ``i >= x.length`` or ``i < 0``). -#. If you access a fixed-length ``bytesN`` at a too large or negative index. -#. If you divide or modulo by zero (e.g. ``5 / 0`` or ``23 % 0``). -#. If you shift by a negative amount. -#. If you convert a value too big or negative into an enum type. -#. If you call a zero-initialized variable of internal function type. -#. If you call ``assert`` with an argument that evaluates to false. - -The ``require`` function should be used to ensure valid conditions +function calls which will cause a Panic. + +A Panic exception is generated in the following situations. +The error code supplied with the error data indicates the kind of panic. + +#. 0x00: Used for generic compiler inserted panics. +#. 0x01: If you call ``assert`` with an argument that evaluates to false. +#. 0x11: If an arithmetic operation results in underflow or overflow outside of an ``unchecked { ... }`` block. +#. 0x12; If you divide or modulo by zero (e.g. ``5 / 0`` or ``23 % 0``). +#. 0x21: If you convert a value that is too big or negative into an enum type. +#. 0x22: If you access a storage byte array that is incorrectly encoded. +#. 0x31: If you call ``.pop()`` on an empty array. +#. 0x32: If you access an array, ``bytesN`` or an array slice at an out-of-bounds or negative index (i.e. ``x[i]`` where ``i >= x.length`` or ``i < 0``). +#. 0x41: If you allocate too much memory or create an array that is too large. +#. 0x51: If you call a zero-initialized variable of internal function type. + +The ``require`` function either creates an error without any data or +an error of type ``Error(string)``. It +should be used to ensure valid conditions that cannot be detected until execution time. This includes conditions on inputs or return values from calls to external contracts. -A ``require``-style exception is generated in the following situations: +.. note:: + + It is currently not possible to use custom errors in combination + with ``require``. Please use ``if (!condition) revert CustomError();`` instead. + +An ``Error(string)`` exception (or an exception without data) is generated +by the compiler +in the following situations: + +#. Calling ``require(x)`` where ``x`` evaluates to ``false``. +#. If you use ``revert()`` or ``revert("description")``. +#. If you perform an external function call targeting a contract that contains no code. +#. If your contract receives Ether via a public function without + ``payable`` modifier (including the constructor and the fallback function). +#. If your contract receives Ether via a public getter function. -#. Calling ``require`` with an argument that evaluates to ``false``. +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): + +#. If a ``.transfer()`` fails. #. If you call a function via a message call but it does not finish properly (i.e., it runs out of gas, has no matching function, or throws an exception itself), except when a low level operation @@ -537,20 +662,22 @@ A ``require``-style exception is generated in the following situations: indicate failures by returning ``false``. #. If you create a contract using the ``new`` keyword but the contract creation :ref:`does not finish properly`. -#. If you perform an external function call targeting a contract that contains no code. -#. If your contract receives Ether via a public function without - ``payable`` modifier (including the constructor and the fallback function). -#. If your contract receives Ether via a public getter function. -#. If a ``.transfer()`` fails. You can optionally provide a message string for ``require``, but not for ``assert``. +.. note:: + If you do not provide a string argument to ``require``, it will revert + with empty error data, not even including the error selector. + + The following example shows how you can use ``require`` to check conditions on inputs and ``assert`` for internal error checking. -:: +.. code-block:: solidity + :force: - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.5.0 <0.9.0; contract Sharer { function sendHalf(address payable addr) public payable returns (uint balance) { @@ -566,37 +693,59 @@ and ``assert`` for internal error checking. } Internally, Solidity performs a revert operation (instruction -``0xfd``) for a ``require``-style exception and executes an invalid operation -(instruction ``0xfe``) to throw an ``assert``-style exception. In both cases, this causes +``0xfd``). This causes the EVM to revert all changes made to the state. The reason for reverting is that there is no safe way to continue execution, because an expected effect did not occur. Because we want to keep the atomicity of transactions, the safest action is to revert all changes and make the whole transaction (or at least call) without effect. -In both cases, the caller can react on such failures using ``try``/``catch`` -(in the failing ``assert``-style exception only if enough gas is left), but -the changes in the caller will always be reverted. +In both cases, the caller can react on such failures using ``try``/``catch``, but +the changes in the callee will always be reverted. .. note:: - ``assert``-style exceptions consume all gas available to the call, - while ``require``-style exceptions do not consume any gas starting from the Metropolis release. + Panic exceptions used to use the ``invalid`` opcode before Solidity 0.8.0, + which consumed all gas available to the call. + Exceptions that use ``require`` used to consume all gas until before the Metropolis release. + +.. _revert-statement: ``revert`` ---------- -The ``revert`` function is another way to trigger exceptions from within other code blocks to flag an error and -revert the current call. The function takes an optional string -message containing details about the error that is passed back to the caller. +A direct revert can be triggered using the ``revert`` statement and the ``revert`` function. + +The ``revert`` statement takes a custom error as direct argument without parentheses: + + revert CustomError(arg1, arg2); + +For backwards-compatibility reasons, there is also the ``revert()`` function, which uses parentheses +and accepts a string: -The following example shows how to use an error string together with ``revert`` and the equivalent ``require``: + revert(); + revert("description"); -:: +The error data will be passed back to the caller and can be caught there. +Using ``revert()`` causes a revert without any error data while ``revert("description")`` +will create an ``Error(string)`` error. - pragma solidity >=0.5.0 <0.7.0; +Using a custom error instance will usually be much cheaper than a string description, +because you can use the name of the error to describe it, which is encoded in only +four bytes. A longer description can be supplied via NatSpec which does not incur +any costs. + +The following example shows how to use an error string and a custom error instance +together with ``revert`` and the equivalent ``require``: + +.. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.4; contract VendingMachine { + address owner; + error Unauthorized(); function buy(uint amount) public payable { if (amount > msg.value / 2 ether) revert("Not enough Ether provided."); @@ -607,9 +756,23 @@ The following example shows how to use an error string together with ``revert`` ); // Perform the purchase. } + function withdraw() public { + if (msg.sender != owner) + revert Unauthorized(); + + payable(msg.sender).transfer(address(this).balance); + } } -The two syntax options are equivalent, it's developer preference which to use. +The two ways ``if (!condition) revert(...);`` and ``require(condition, ...);`` are +equivalent as long as the arguments to ``revert`` and ``require`` do not have side-effects, +for example if they are just strings. + +.. note:: + The ``require`` function is evaluated just as any other function. + This means that all arguments are evaluated before the function itself is executed. + In particular, in ``require(condition, f())`` the function ``f`` is executed even if + ``condition`` is true. The provided string is :ref:`abi-encoded ` as if it were a call to a function ``Error(string)``. In the above example, ``revert("Not enough Ether provided.");`` returns the following hexadecimal as error return data: @@ -635,9 +798,10 @@ The provided message can be retrieved by the caller using ``try``/``catch`` as s A failure in an external call can be caught using a try/catch statement, as follows: -:: +.. code-block:: solidity - pragma solidity ^0.6.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.8.1; interface DataFeed { function getData(address token) external returns (uint value); } @@ -656,10 +820,15 @@ A failure in an external call can be caught using a try/catch statement, as foll // and a reason string was provided. errorCount++; return (0, false); + } catch Panic(uint /*errorCode*/) { + // This is executed in case of a panic, + // i.e. a serious error like division by zero + // or overflow. The error code can be used + // to determine the kind of error. + errorCount++; + return (0, false); } catch (bytes memory /*lowLevelData*/) { - // This is executed in case revert() was used - // or there was a failing assertion, division - // by zero, etc. inside getData. + // This is executed in case revert() was used. errorCount++; return (0, false); } @@ -675,24 +844,28 @@ matching the types returned by the external call. In case there was no error, these variables are assigned and the contract's execution continues inside the first success block. If the end of the success block is reached, execution continues after the ``catch`` blocks. -Currently, Solidity supports different kinds of catch blocks depending on the -type of error. If the error was caused by ``revert("reasonString")`` or -``require(false, "reasonString")`` (or an internal error that causes such an -exception), then the catch clause -of the type ``catch Error(string memory reason)`` will be executed. +Solidity supports different kinds of catch blocks depending on the +type of error: -It is planned to support other types of error data in the future. -The string ``Error`` is currently parsed as is and is not treated as an identifier. +- ``catch Error(string memory reason) { ... }``: This catch clause is executed if the error was caused by ``revert("reasonString")`` or + ``require(false, "reasonString")`` (or an internal error that causes such an + exception). -The clause ``catch (bytes memory lowLevelData)`` is executed if the error signature -does not match any other clause, there was an error during decoding of the error -message, if there was a failing assertion in the external -call (for example due to a division by zero or a failing ``assert()``) or -if no error data was provided with the exception. -The declared variable provides access to the low-level error data in that case. +- ``catch Panic(uint errorCode) { ... }``: If the error was caused by a panic, i.e. by a failing ``assert``, division by zero, + invalid array access, arithmetic overflow and others, this catch clause will be run. -If you are not interested in the error data, you can just use -``catch { ... }`` (even as the only catch clause). +- ``catch (bytes memory lowLevelData) { ... }``: This clause is executed if the error signature + does not match any other clause, if there was an error while decoding the error + message, or + if no error data was provided with the exception. + The declared variable provides access to the low-level error data in that case. + +- ``catch { ... }``: If you are not interested in the error data, you can just use + ``catch { ... }`` (even as the only catch clause) instead of the previous clause. + + +It is planned to support other types of error data in the future. +The strings ``Error`` and ``Panic`` are currently parsed as is and are not treated as identifiers. In order to catch all error cases, you have to have at least the clause ``catch { ...}`` or the clause ``catch (bytes memory lowLevelData) { ... }``. @@ -724,6 +897,6 @@ in scope in the block that follows. The error might have happened deeper down in the call chain and the called contract just forwarded it. Also, it could be due to an out-of-gas situation and not a deliberate error condition: - The caller always retains 63/64th of the gas in a call and thus + The caller always retains at least 1/64th of the gas in a call and thus even if the called contract goes out of gas, the caller still - has some gas left. \ No newline at end of file + has some gas left. diff --git a/compiler/docs/credits-and-attribution.rst b/compiler/docs/credits-and-attribution.rst new file mode 100644 index 00000000..f1aa6cfd --- /dev/null +++ b/compiler/docs/credits-and-attribution.rst @@ -0,0 +1,21 @@ +.. This page is meant to be linked to from the footer. + +:orphan: + +####################### +Credits and Attribution +####################### + +Website icons +============= + +.. |icon-share-solid| image:: _static/img/solid-share-arrow.svg +.. _share icon: https://fontawesome.com/v5.15/icons/share?style=solid +.. _Font Awesome Free License: https://fontawesome.com/license/free + ++-------------------------+-----------------------------------------------------------------------+ +| Icon | Attribution | ++=========================+=======================================================================+ +| |icon-share-solid| | - Source: `share icon`_ from Font Awesome 5.15.0. | +| | - License: `Font Awesome Free License`_ (CC BY 4.0). | ++-------------------------+-----------------------------------------------------------------------+ diff --git a/compiler/scripts/docs.sh b/compiler/docs/docs.sh similarity index 86% rename from compiler/scripts/docs.sh rename to compiler/docs/docs.sh index 2c08a82b..f2c56676 100755 --- a/compiler/scripts/docs.sh +++ b/compiler/docs/docs.sh @@ -5,7 +5,7 @@ # # The documentation for solidity is hosted at: # -# https://solidity.readthedocs.org +# https://docs.soliditylang.org # # ------------------------------------------------------------------------------ # This file is part of solidity. @@ -26,8 +26,10 @@ # (c) 2016 solidity contributors. #------------------------------------------------------------------------------ -set -e -cd docs -pip install -r requirements.txt +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 .. diff --git a/compiler/docs/examples/blind-auction.rst b/compiler/docs/examples/blind-auction.rst index 92a75597..b0a86f24 100644 --- a/compiler/docs/examples/blind-auction.rst +++ b/compiler/docs/examples/blind-auction.rst @@ -18,14 +18,14 @@ 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 previously highest bidder gets their money back. After the end of +raised, the previous highest bidder gets their money 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. -:: - - pragma solidity >=0.4.22 <0.7.0; +.. code-block:: solidity + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.4; contract SimpleAuction { // Parameters of the auction. Times are either // absolute unix timestamps (seconds since 1970-01-01) @@ -48,27 +48,38 @@ to receive their money - contracts cannot activate themselves. event HighestBidIncreased(address bidder, uint amount); event AuctionEnded(address winner, uint amount); - // The following is a so-called natspec comment, - // recognizable by the three slashes. - // It will be shown when the user is asked to - // confirm a transaction. + // Errors that describe failures. + + // The triple-slash comments are so-called natspec + // comments. They will be shown when the user + // is asked to confirm a transaction or + // when an error is displayed. - /// Create a simple auction with `_biddingTime` + /// The auction has already ended. + error AuctionAlreadyEnded(); + /// There is already a higher or equal bid. + error BidNotHighEnough(uint highestBid); + /// The auction has not ended yet. + error AuctionNotYetEnded(); + /// The function auctionEnd has already been called. + error AuctionEndAlreadyCalled(); + + /// Create a simple auction with `biddingTime` /// seconds bidding time on behalf of the - /// beneficiary address `_beneficiary`. + /// beneficiary address `beneficiaryAddress`. constructor( - uint _biddingTime, - address payable _beneficiary - ) public { - beneficiary = _beneficiary; - auctionEndTime = now + _biddingTime; + uint biddingTime, + address payable beneficiaryAddress + ) { + beneficiary = beneficiaryAddress; + auctionEndTime = block.timestamp + biddingTime; } /// Bid on the auction with the value sent /// together with this transaction. /// The value will only be refunded if the /// auction is not won. - function bid() public payable { + function bid() external payable { // No arguments are necessary, all // information is already part of // the transaction. The keyword payable @@ -77,20 +88,16 @@ to receive their money - contracts cannot activate themselves. // Revert the call if the bidding // period is over. - require( - now <= auctionEndTime, - "Auction already ended." - ); + if (block.timestamp > auctionEndTime) + revert AuctionAlreadyEnded(); // If the bid is not higher, send the - // money back (the failing require + // money back (the revert statement // will revert all changes in this // function execution including // it having received the money). - require( - msg.value > highestBid, - "There already is a higher bid." - ); + if (msg.value <= highestBid) + revert BidNotHighEnough(highestBid); if (highestBid != 0) { // Sending back the money by simply using @@ -106,7 +113,7 @@ to receive their money - contracts cannot activate themselves. } /// Withdraw a bid that was overbid. - function withdraw() public returns (bool) { + function withdraw() external returns (bool) { uint amount = pendingReturns[msg.sender]; if (amount > 0) { // It is important to set this to zero because the recipient @@ -114,7 +121,10 @@ to receive their money - contracts cannot activate themselves. // before `send` returns. pendingReturns[msg.sender] = 0; - if (!msg.sender.send(amount)) { + // msg.sender is not of type `address payable` and must be + // explicitly converted using `payable(msg.sender)` in order + // use the member function `send()`. + if (!payable(msg.sender).send(amount)) { // No need to call throw here, just reset the amount owing pendingReturns[msg.sender] = amount; return false; @@ -125,7 +135,7 @@ to receive their money - contracts cannot activate themselves. /// End the auction and send the highest bid /// to the beneficiary. - function auctionEnd() public { + function auctionEnd() external { // It is a good guideline to structure functions that interact // with other contracts (i.e. they call functions or send Ether) // into three phases: @@ -140,8 +150,10 @@ to receive their money - contracts cannot activate themselves. // external contracts. // 1. Conditions - require(now >= auctionEndTime, "Auction not yet ended."); - require(!ended, "auctionEnd has already been called."); + if (block.timestamp < auctionEndTime) + revert AuctionNotYetEnded(); + if (ended) + revert AuctionEndAlreadyCalled(); // 2. Effects ended = true; @@ -182,10 +194,11 @@ transfers): Bidders can confuse competition by placing several high or low invalid bids. -:: - - pragma solidity >0.4.23 <0.7.0; +.. code-block:: solidity + :force: + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.4; contract BlindAuction { struct Bid { bytes32 blindedBid; @@ -207,24 +220,41 @@ invalid bids. event AuctionEnded(address winner, uint highestBid); - /// Modifiers are a convenient way to validate inputs to - /// functions. `onlyBefore` is applied to `bid` below: - /// The new function body is the modifier's body where - /// `_` is replaced by the old function body. - modifier onlyBefore(uint _time) { require(now < _time); _; } - modifier onlyAfter(uint _time) { require(now > _time); _; } + // Errors that describe failures. + + /// The function has been called too early. + /// Try again at `time`. + error TooEarly(uint time); + /// The function has been called too late. + /// It cannot be called after `time`. + error TooLate(uint time); + /// The function auctionEnd has already been called. + error AuctionEndAlreadyCalled(); + + // Modifiers are a convenient way to validate inputs to + // functions. `onlyBefore` is applied to `bid` below: + // The new function body is the modifier's body where + // `_` is replaced by the old function body. + modifier onlyBefore(uint time) { + if (block.timestamp >= time) revert TooLate(time); + _; + } + modifier onlyAfter(uint time) { + if (block.timestamp <= time) revert TooEarly(time); + _; + } constructor( - uint _biddingTime, - uint _revealTime, - address payable _beneficiary - ) public { - beneficiary = _beneficiary; - biddingEnd = now + _biddingTime; - revealEnd = biddingEnd + _revealTime; + uint biddingTime, + uint revealTime, + address payable beneficiaryAddress + ) { + beneficiary = beneficiaryAddress; + biddingEnd = block.timestamp + biddingTime; + revealEnd = biddingEnd + revealTime; } - /// Place a blinded bid with `_blindedBid` = + /// Place a blinded bid with `blindedBid` = /// keccak256(abi.encodePacked(value, fake, secret)). /// The sent ether is only refunded if the bid is correctly /// revealed in the revealing phase. The bid is valid if the @@ -233,13 +263,13 @@ invalid bids. /// not the exact amount are ways to hide the real bid but /// still make the required deposit. The same address can /// place multiple bids. - function bid(bytes32 _blindedBid) - public + function bid(bytes32 blindedBid) + external payable onlyBefore(biddingEnd) { bids[msg.sender].push(Bid({ - blindedBid: _blindedBid, + blindedBid: blindedBid, deposit: msg.value })); } @@ -248,24 +278,24 @@ invalid bids. /// correctly blinded invalid bids and for all bids except for /// the totally highest. function reveal( - uint[] memory _values, - bool[] memory _fake, - bytes32[] memory _secret + uint[] calldata values, + bool[] calldata fakes, + bytes32[] calldata secrets ) - public + external onlyAfter(biddingEnd) onlyBefore(revealEnd) { uint length = bids[msg.sender].length; - require(_values.length == length); - require(_fake.length == length); - require(_secret.length == length); + require(values.length == length); + require(fakes.length == length); + require(secrets.length == length); uint refund; for (uint i = 0; i < length; i++) { Bid storage bidToCheck = bids[msg.sender][i]; (uint value, bool fake, bytes32 secret) = - (_values[i], _fake[i], _secret[i]); + (values[i], fakes[i], secrets[i]); if (bidToCheck.blindedBid != keccak256(abi.encodePacked(value, fake, secret))) { // Bid was not actually revealed. // Do not refund deposit. @@ -280,11 +310,11 @@ invalid bids. // the same deposit. bidToCheck.blindedBid = bytes32(0); } - msg.sender.transfer(refund); + payable(msg.sender).transfer(refund); } /// Withdraw a bid that was overbid. - function withdraw() public { + function withdraw() external { uint amount = pendingReturns[msg.sender]; if (amount > 0) { // It is important to set this to zero because the recipient @@ -293,17 +323,17 @@ invalid bids. // conditions -> effects -> interaction). pendingReturns[msg.sender] = 0; - msg.sender.transfer(amount); + payable(msg.sender).transfer(amount); } } /// End the auction and send the highest bid /// to the beneficiary. function auctionEnd() - public + external onlyAfter(revealEnd) { - require(!ended); + if (ended) revert AuctionEndAlreadyCalled(); emit AuctionEnded(highestBidder, highestBid); ended = true; beneficiary.transfer(highestBid); @@ -326,4 +356,4 @@ invalid bids. highestBidder = bidder; return true; } - } \ No newline at end of file + } diff --git a/compiler/docs/examples/micropayment.rst b/compiler/docs/examples/micropayment.rst index fe310f37..c95d7c5e 100644 --- a/compiler/docs/examples/micropayment.rst +++ b/compiler/docs/examples/micropayment.rst @@ -11,8 +11,8 @@ sign and verify signatures, and setup the payment channel. Creating and verifying signatures ================================= -Imagine Alice wants to send a quantity of Ether to Bob, i.e. -Alice is the sender and the Bob is the recipient. +Imagine Alice wants to send some Ether to Bob, i.e. +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. @@ -24,10 +24,10 @@ to initiate a payment, she will let Bob do that, and therefore pay the transacti 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 their private key. + 2. Alice authorises 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 their payment by presenting the signed message to the smart contract, it verifies the + 4. Bob claims his payment by presenting the signed message to the smart contract, it verifies the authenticity of the message and then releases the funds. Creating the signature @@ -37,10 +37,10 @@ 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 `_ and -`MetaMask `_, using the method described in `EIP-762 `_, +`MetaMask `_, using the method described in `EIP-712 `_, as it provides a number of other security benefits. -:: +.. code-block:: javascript /// Hashing first makes things easier var hash = web3.utils.sha3("message to sign"); @@ -61,12 +61,11 @@ For a contract that fulfils payments, the signed message must include: 2. The amount to be transferred. 3. Protection against replay attacks. -A replay attack is when a signed message is reused to claim authorization for -a second action. -To avoid replay attacks we use the same as in Ethereum transactions -themselves, a so-called nonce, which is the number of transactions sent by an -account. -The smart contract checks if a nonce is used multiple times. +A replay attack is when a signed message is reused to claim +authorization for a second action. To avoid replay attacks +we use the same technique as in Ethereum transactions themselves, +a so-called nonce, which is the number of transactions sent by +an account. The smart contract checks if a nonce is used multiple times. Another type of replay attack can occur when the owner deploys a ``ReceiverPays`` smart contract, makes some @@ -91,7 +90,7 @@ library provides a function called ``soliditySHA3`` that mimics the behaviour 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: -:: +.. code-block:: javascript // recipient is the address that should be paid. // amount, in wei, specifies how much ether should be sent. @@ -114,7 +113,7 @@ In general, ECDSA signatures consist of two parameters, parameter called ``v``, that you can use to verify which account's private key was used to sign the message, and the transaction's sender. Solidity provides a built-in -function `ecrecover `_ that +function :ref:`ecrecover ` that accepts a message along with the ``r``, ``s`` and ``v`` parameters and returns the address that was used to sign the message. @@ -127,7 +126,7 @@ apart. You can do this on the client-side, but doing it inside the smart contract means you only need to send one signature parameter rather than three. Splitting apart a byte array into its constituent parts is a mess, so we use -`inline assembly `_ to do the job in the ``splitSignature`` +:doc:`inline assembly ` to do the job in the ``splitSignature`` function (the third function in the full contract at the end of this section). Computing the Message Hash @@ -140,18 +139,19 @@ The functions ``prefixed`` and ``recoverSigner`` do this in the ``claimPayment`` The full contract ----------------- -:: - - pragma solidity >=0.4.24 <0.7.0; +.. code-block:: solidity + :force: + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; contract ReceiverPays { address owner = msg.sender; mapping(uint256 => bool) usedNonces; - constructor() public payable {} + constructor() payable {} - function claimPayment(uint256 amount, uint256 nonce, bytes memory signature) public { + function claimPayment(uint256 amount, uint256 nonce, bytes memory signature) external { require(!usedNonces[nonce]); usedNonces[nonce] = true; @@ -160,13 +160,13 @@ The full contract require(recoverSigner(message, signature) == owner); - msg.sender.transfer(amount); + payable(msg.sender).transfer(amount); } /// destroy the contract and reclaim the leftover funds. - function shutdown() public { + function shutdown() external { require(msg.sender == owner); - selfdestruct(msg.sender); + selfdestruct(payable(msg.sender)); } /// signature methods. @@ -223,7 +223,7 @@ unidirectional payment channel between two parties (Alice and Bob). It involves 1. Alice funds a smart contract with Ether. This "opens" the payment channel. 2. Alice signs messages that specify how much of that Ether is owed to the recipient. This step is repeated for each payment. - 3. Bob "closes" the payment channel, withdrawing their portion of the Ether and sending the remainder back to the sender. + 3. Bob "closes" the payment channel, withdrawing his portion of the Ether and sending the remainder back to the sender. .. note:: Only steps 1 and 3 require Ethereum transactions, step 2 means that the sender @@ -231,9 +231,9 @@ unidirectional payment channel between two parties (Alice and Bob). It involves methods (e.g. email). This means only two transactions are required to support any number of transfers. -Bob is guaranteed to receive their funds because the smart contract escrows the +Bob is guaranteed to receive his funds because the smart contract escrows the Ether and honours a valid signed message. The smart contract also enforces a -timeout, so Alice is guaranteed to eventually recover their funds even if the +timeout, so Alice is guaranteed to eventually recover her funds even if the recipient refuses to close the channel. It is up to the participants in a payment channel to decide how long to keep it open. For a short-lived transaction, such as paying an internet café for each minute of network access, the payment @@ -272,7 +272,7 @@ to prevent a message intended for one payment channel from being used for a diff Here is the modified JavaScript code to cryptographically sign a message from the previous section: -:: +.. code-block:: javascript function constructPaymentMessage(contractAddress, amount) { return abi.soliditySHA3( @@ -301,7 +301,7 @@ Here is the modified JavaScript code to cryptographically sign a message from th Closing the Payment Channel --------------------------- -When Bob is ready to receive their funds, it is time to +When Bob is ready to receive his funds, it is time to close the payment channel by calling a ``close`` function on the smart contract. Closing the channel pays the recipient the Ether they are owed and destroys the contract, sending any remaining Ether back to Alice. To @@ -326,9 +326,9 @@ Channel Expiration ------------------- Bob can close the payment channel at any time, but if they fail to do so, -Alice needs a way to recover their escrowed funds. An *expiration* time was set +Alice needs a way to recover her escrowed funds. An *expiration* time was set at the time of contract deployment. Once that time is reached, Alice can call -``claimTimeout`` to recover their funds. You can see the ``claimTimeout`` function in the full contract. +``claimTimeout`` to recover her funds. You can see the ``claimTimeout`` function in the full contract. After this function is called, Bob can no longer receive any Ether, so it is important that Bob closes the channel before the expiration is reached. @@ -336,28 +336,28 @@ so it is important that Bob closes the channel before the expiration is reached. The full contract ----------------- -:: - - pragma solidity >=0.4.24 <0.7.0; +.. code-block:: solidity + :force: + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; contract SimplePaymentChannel { address payable public sender; // The account sending payments. address payable public recipient; // The account receiving the payments. uint256 public expiration; // Timeout in case the recipient never closes. - constructor (address payable _recipient, uint256 duration) - public + constructor (address payable recipientAddress, uint256 duration) payable { - sender = msg.sender; - recipient = _recipient; - expiration = now + duration; + sender = payable(msg.sender); + recipient = recipientAddress; + expiration = block.timestamp + duration; } /// the recipient can close the channel at any time by presenting a /// signed amount from the sender. the recipient will be sent that amount, /// and the remainder will go back to the sender - function close(uint256 amount, bytes memory signature) public { + function close(uint256 amount, bytes memory signature) external { require(msg.sender == recipient); require(isValidSignature(amount, signature)); @@ -366,7 +366,7 @@ The full contract } /// the sender can extend the expiration at any time - function extend(uint256 newExpiration) public { + function extend(uint256 newExpiration) external { require(msg.sender == sender); require(newExpiration > expiration); @@ -375,8 +375,8 @@ The full contract /// if the timeout is reached without the recipient closing the channel, /// then the Ether is released back to the sender. - function claimTimeout() public { - require(now >= expiration); + function claimTimeout() external { + require(block.timestamp >= expiration); selfdestruct(sender); } @@ -433,7 +433,7 @@ The full contract .. note:: The function ``splitSignature`` does not use all security checks. A real implementation should use a more rigorously tested library, - such as openzepplin's `version `_ of this code. + such as openzepplin's `version `_ of this code. Verifying Payments ------------------ @@ -447,16 +447,16 @@ in the end. The recipient should verify each message using the following process: - 1. Verify that the contact address in the message matches the payment channel. + 1. Verify that the contract address in the message matches the payment channel. 2. Verify that the new total is the expected amount. 3. Verify that the new total does not exceed the amount of Ether escrowed. 4. Verify that the signature is valid and comes from the payment channel sender. We'll use the `ethereumjs-util `_ library to write this verification. The final step can be done a number of ways, -and we use JavaScript. The following code borrows the `constructMessage` function from the signing **JavaScript code** above: +and we use JavaScript. The following code borrows the ``constructPaymentMessage`` function from the signing **JavaScript code** above: -:: +.. code-block:: javascript // this mimics the prefixing behavior of the eth_sign JSON-RPC method. function prefixed(hash) { diff --git a/compiler/docs/examples/modular.rst b/compiler/docs/examples/modular.rst index a3d932b0..697699ae 100644 --- a/compiler/docs/examples/modular.rst +++ b/compiler/docs/examples/modular.rst @@ -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 behaviour 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 @@ -17,9 +17,10 @@ provides an isolated component that properly tracks balances of accounts. It is easy to verify that the ``Balances`` library never produces negative balances or overflows and the sum of all balances is an invariant across the lifetime of the contract. -:: +.. code-block:: solidity - pragma solidity >=0.4.22 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.5.0 <0.9.0; library Balances { function move(mapping(address => uint256) storage balances, address from, address to, uint amount) internal { @@ -38,14 +39,14 @@ and the sum of all balances is an invariant across the lifetime of the contract. event Transfer(address from, address to, uint amount); event Approval(address owner, address spender, uint amount); - function transfer(address to, uint amount) public returns (bool success) { + function transfer(address to, uint amount) external returns (bool success) { balances.move(msg.sender, to, amount); emit Transfer(msg.sender, to, amount); return true; } - function transferFrom(address from, address to, uint amount) public returns (bool success) { + function transferFrom(address from, address to, uint amount) external returns (bool success) { require(allowed[from][msg.sender] >= amount); allowed[from][msg.sender] -= amount; balances.move(from, to, amount); @@ -53,14 +54,14 @@ and the sum of all balances is an invariant across the lifetime of the contract. return true; } - function approve(address spender, uint tokens) public returns (bool success) { + function approve(address spender, uint tokens) external returns (bool success) { require(allowed[msg.sender][spender] == 0, ""); allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } - function balanceOf(address tokenOwner) public view returns (uint balance) { + function balanceOf(address tokenOwner) external view returns (uint balance) { return balances[tokenOwner]; } } diff --git a/compiler/docs/examples/safe-remote.rst b/compiler/docs/examples/safe-remote.rst index d79c6526..e42b017f 100644 --- a/compiler/docs/examples/safe-remote.rst +++ b/compiler/docs/examples/safe-remote.rst @@ -23,10 +23,10 @@ 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. -:: - - pragma solidity >=0.4.22 <0.7.0; +.. code-block:: solidity + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.4; contract Purchase { uint public value; address payable public seller; @@ -36,32 +36,35 @@ you can use state machine-like constructs inside a contract. // The state variable has a default value of the first member, `State.created` State public state; - modifier condition(bool _condition) { - require(_condition); + modifier condition(bool condition_) { + require(condition_); _; } + /// Only the buyer can call this function. + error OnlyBuyer(); + /// Only the seller can call this function. + error OnlySeller(); + /// The function cannot be called at the current state. + error InvalidState(); + /// The provided value has to be even. + error ValueNotEven(); + modifier onlyBuyer() { - require( - msg.sender == buyer, - "Only buyer can call this." - ); + if (msg.sender != buyer) + revert OnlyBuyer(); _; } modifier onlySeller() { - require( - msg.sender == seller, - "Only seller can call this." - ); + if (msg.sender != seller) + revert OnlySeller(); _; } - modifier inState(State _state) { - require( - state == _state, - "Invalid state." - ); + modifier inState(State state_) { + if (state != state_) + revert InvalidState(); _; } @@ -73,17 +76,18 @@ you can use state machine-like constructs inside a contract. // Ensure that `msg.value` is an even number. // Division will truncate if it is an odd number. // Check via multiplication that it wasn't an odd number. - constructor() public payable { - seller = msg.sender; + constructor() payable { + seller = payable(msg.sender); value = msg.value / 2; - require((2 * value) == msg.value, "Value has to be even."); + if ((2 * value) != msg.value) + revert ValueNotEven(); } /// Abort the purchase and reclaim the ether. /// Can only be called by the seller before /// the contract is locked. function abort() - public + external onlySeller inState(State.Created) { @@ -101,20 +105,20 @@ you can use state machine-like constructs inside a contract. /// The ether will be locked until confirmReceived /// is called. function confirmPurchase() - public + external inState(State.Created) condition(msg.value == (2 * value)) payable { emit PurchaseConfirmed(); - buyer = msg.sender; + buyer = payable(msg.sender); state = State.Locked; } /// Confirm that you (the buyer) received the item. /// This will release the locked ether. function confirmReceived() - public + external onlyBuyer inState(State.Locked) { @@ -130,7 +134,7 @@ you can use state machine-like constructs inside a contract. /// This function refunds the seller, i.e. /// pays back the locked funds of the seller. function refundSeller() - public + external onlySeller inState(State.Release) { @@ -142,4 +146,4 @@ you can use state machine-like constructs inside a contract. seller.transfer(3 * value); } - } \ No newline at end of file + } diff --git a/compiler/docs/examples/voting.rst b/compiler/docs/examples/voting.rst index e4b6da20..de899da7 100644 --- a/compiler/docs/examples/voting.rst +++ b/compiler/docs/examples/voting.rst @@ -30,10 +30,10 @@ At the end of the voting time, ``winningProposal()`` will return the proposal with the largest number of votes. -:: - - pragma solidity >=0.4.22 <0.7.0; +.. code-block:: solidity + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; /// @title Voting with delegation. contract Ballot { // This declares a new complex type which will @@ -62,7 +62,7 @@ of votes. Proposal[] public proposals; /// Create a new ballot to choose one of `proposalNames`. - constructor(bytes32[] memory proposalNames) public { + constructor(bytes32[] memory proposalNames) { chairperson = msg.sender; voters[chairperson].weight = 1; @@ -82,7 +82,7 @@ of votes. // Give `voter` the right to vote on this ballot. // May only be called by `chairperson`. - function giveRightToVote(address voter) public { + function giveRightToVote(address voter) external { // If the first argument of `require` evaluates // to `false`, execution terminates and all // changes to the state and to Ether balances @@ -106,9 +106,10 @@ of votes. } /// Delegate your vote to the voter `to`. - function delegate(address to) public { + 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,11 +129,16 @@ of votes. require(to != msg.sender, "Found loop in delegation."); } + Voter storage delegate_ = voters[to]; + + // Voters cannot delegate to accounts that cannot vote. + require(delegate_.weight >= 1); + // Since `sender` is a reference, this - // modifies `voters[msg.sender].voted` + // modifies `voters[msg.sender]`. sender.voted = true; sender.delegate = to; - Voter storage delegate_ = voters[to]; + if (delegate_.voted) { // If the delegate already voted, // directly add to the number of votes @@ -146,7 +152,7 @@ of votes. /// Give your vote (including votes delegated to you) /// to proposal `proposals[proposal].name`. - function vote(uint proposal) public { + function vote(uint proposal) external { Voter storage sender = voters[msg.sender]; require(sender.weight != 0, "Has no right to vote"); require(!sender.voted, "Already voted."); @@ -176,7 +182,7 @@ of votes. // Calls winningProposal() function to get the index // of the winner contained in the proposals array and then // returns the name of the winner - function winnerName() public view + function winnerName() external view returns (bytes32 winnerName_) { winnerName_ = proposals[winningProposal()].name; @@ -187,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? \ No newline at end of file diff --git a/compiler/docs/ext/html_extra_template_renderer.py b/compiler/docs/ext/html_extra_template_renderer.py new file mode 100644 index 00000000..29dd9ee1 --- /dev/null +++ b/compiler/docs/ext/html_extra_template_renderer.py @@ -0,0 +1,45 @@ +import os.path + + +def render_html_extra_templates(app): + if app.builder.format != 'html': + # Non-HTML builders do not provide .templates.render_string(). Note that a HTML + # builder is still used also when building some other formats like json or epub. + return + + for input_path, template_config in app.config.html_extra_templates.items(): + # Requiring absolute paths simplifies the implementation. + if not os.path.isabs(input_path): + raise RuntimeError(f"Template input path is not absolute: {input_path}") + if not os.path.isabs(template_config['target']): + raise RuntimeError(f"Template target path is not absolute: {template_config['target']}") + + with open(input_path, 'r', encoding='utf8') as input_file: + # This runs Jinja2, which supports rendering {{ }} tags among other things. + rendered_template = app.builder.templates.render_string( + input_file.read(), + template_config['context'], + ) + + with open(template_config['target'], 'w', encoding='utf8') as target_file: + target_file.write(rendered_template) + + app.config.html_extra_path.append(template_config['target']) + + +def setup(app): + app.add_config_value('html_extra_templates', default={}, rebuild='', types=dict) + + # Register a handler for the env-before-read-docs event. Any event that's fired before static + # files get copied would do. + app.connect( + 'env-before-read-docs', + lambda app, env, docnames: render_html_extra_templates(app) + ) + + return { + # NOTE: Need to access _raw_config here because setup() runs before app.config is ready. + 'version': app.config._raw_config['version'], # pylint: disable=protected-access + 'parallel_read_safe': True, + 'parallel_write_safe': True, + } diff --git a/compiler/docs/ext/remix_code_links.py b/compiler/docs/ext/remix_code_links.py new file mode 100644 index 00000000..2fc15ddd --- /dev/null +++ b/compiler/docs/ext/remix_code_links.py @@ -0,0 +1,83 @@ +import base64 +import docutils # pragma pylint: disable=import-error + +from sphinx.util import logging # pragma pylint: disable=import-error + +# NOTE: 2000 should generally be safe for all browsers, while 8000 for most of them. +MAX_SAFE_URL_LENGTH = 10000 + +logger = logging.getLogger(__name__) + + +def insert_node_before(child, new_sibling): + assert child in child.parent.children + + for position, node in enumerate(child.parent.children): + if node == child: + child.parent.insert(position, new_sibling) + break + + +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}" + + +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.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 + return paragraph_node + + +def insert_remix_link(app, doctree, solidity_version): + if app.builder.format != 'html' or app.builder.name == 'epub': + return + + 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 + + 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): + # NOTE: Need to access _raw_config here because setup() runs before app.config is ready. + solidity_version = app.config._raw_config['version'] # pylint: disable=protected-access + + app.connect( + 'doctree-resolved', + lambda app, doctree, docname: insert_remix_link(app, doctree, solidity_version) + ) + + return { + 'version': solidity_version, + 'parallel_read_safe': True, + 'parallel_write_safe': True, + } diff --git a/compiler/docs/grammar.rst b/compiler/docs/grammar.rst new file mode 100644 index 00000000..788b6d69 --- /dev/null +++ b/compiler/docs/grammar.rst @@ -0,0 +1,13 @@ +**************** +Language Grammar +**************** + +.. a4:autogrammar:: SolidityParser + :only-reachable-from: SolidityParser.sourceUnit + :undocumented: + :cc-to-dash: + +.. a4:autogrammar:: SolidityLexer + :only-reachable-from: SolidityParser.sourceUnit + :fragments: + :cc-to-dash: \ No newline at end of file diff --git a/compiler/docs/grammar.txt b/compiler/docs/grammar.txt deleted file mode 100644 index b8b2893a..00000000 --- a/compiler/docs/grammar.txt +++ /dev/null @@ -1,193 +0,0 @@ -SourceUnit = (PragmaDirective | ImportDirective | ContractDefinition)* - -// Pragma actually parses anything up to the trailing ';' to be fully forward-compatible. -PragmaDirective = 'pragma' Identifier ([^;]+) ';' - -ImportDirective = 'import' StringLiteral ('as' Identifier)? ';' - | 'import' ('*' | Identifier) ('as' Identifier)? 'from' StringLiteral ';' - | 'import' '{' Identifier ('as' Identifier)? ( ',' Identifier ('as' Identifier)? )* '}' 'from' StringLiteral ';' - -ContractDefinition = 'abstract'? ( 'contract' | 'library' | 'interface' ) Identifier - ( 'is' InheritanceSpecifier (',' InheritanceSpecifier )* )? - '{' ContractPart* '}' - -ContractPart = StateVariableDeclaration | UsingForDeclaration - | StructDefinition | ModifierDefinition | FunctionDefinition | EventDefinition | EnumDefinition - -InheritanceSpecifier = UserDefinedTypeName ( '(' Expression ( ',' Expression )* ')' )? - -StateVariableDeclaration = TypeName ( 'public' | 'internal' | 'private' | 'constant' | OverrideSpecifier )* Identifier ('=' Expression)? ';' -UsingForDeclaration = 'using' Identifier 'for' ('*' | TypeName) ';' -StructDefinition = 'struct' Identifier '{' - ( VariableDeclaration ';' (VariableDeclaration ';')* ) '}' - -ModifierDefinition = 'modifier' Identifier ParameterList? ( 'virtual' | OverrideSpecifier )* Block -ModifierInvocation = Identifier ( '(' ExpressionList? ')' )? - -FunctionDefinition = FunctionDescriptor ParameterList - ( ModifierInvocation | StateMutability | 'external' | 'public' | 'internal' | 'private' | 'virtual' | OverrideSpecifier )* - ( 'returns' ParameterList )? ( ';' | Block ) - -FunctionDescriptor = 'function' Identifier | 'constructor' | 'fallback' | 'receive' - -OverrideSpecifier = 'override' ( '(' UserDefinedTypeName (',' UserDefinedTypeName)* ')' )? - -EventDefinition = 'event' Identifier EventParameterList 'anonymous'? ';' - -EnumValue = Identifier -EnumDefinition = 'enum' Identifier '{' EnumValue? (',' EnumValue)* '}' - -ParameterList = '(' ( Parameter (',' Parameter)* )? ')' -Parameter = TypeName StorageLocation? Identifier? - -EventParameterList = '(' ( EventParameter (',' EventParameter )* )? ')' -EventParameter = TypeName 'indexed'? Identifier? - -FunctionTypeParameterList = '(' ( FunctionTypeParameter (',' FunctionTypeParameter )* )? ')' -FunctionTypeParameter = TypeName StorageLocation? - -// semantic restriction: mappings and structs (recursively) containing mappings -// are not allowed in argument lists -VariableDeclaration = TypeName StorageLocation? Identifier - -TypeName = ElementaryTypeName - | UserDefinedTypeName - | Mapping - | ArrayTypeName - | FunctionTypeName - | ( 'address' 'payable' ) - -UserDefinedTypeName = Identifier ( '.' Identifier )* - -Mapping = 'mapping' '(' ( ElementaryTypeName | UserDefinedTypeName ) '=>' TypeName ')' -ArrayTypeName = TypeName '[' Expression? ']' -FunctionTypeName = 'function' FunctionTypeParameterList ( 'internal' | 'external' | StateMutability )* - ( 'returns' FunctionTypeParameterList )? -StorageLocation = 'memory' | 'storage' | 'calldata' -StateMutability = 'pure' | 'view' | 'payable' - -Block = '{' Statement* '}' -Statement = IfStatement | TryStatement | WhileStatement | ForStatement | Block | InlineAssemblyStatement | - ( DoWhileStatement | PlaceholderStatement | Continue | Break | Return | - Throw | EmitStatement | SimpleStatement ) ';' - -ExpressionStatement = Expression -IfStatement = 'if' '(' Expression ')' Statement ( 'else' Statement )? -TryStatement = 'try' Expression ( 'returns' ParameterList )? Block CatchClause+ -CatchClause = 'catch' ( Identifier? ParameterList )? Block -WhileStatement = 'while' '(' Expression ')' Statement -PlaceholderStatement = '_' -SimpleStatement = VariableDefinition | ExpressionStatement -ForStatement = 'for' '(' (SimpleStatement)? ';' (Expression)? ';' (ExpressionStatement)? ')' Statement -InlineAssemblyStatement = 'assembly' StringLiteral? AssemblyBlock -DoWhileStatement = 'do' Statement 'while' '(' Expression ')' -Continue = 'continue' -Break = 'break' -Return = 'return' Expression? -Throw = 'throw' -EmitStatement = 'emit' FunctionCall -VariableDefinition = (VariableDeclaration | '(' VariableDeclaration? (',' VariableDeclaration? )* ')' ) ( '=' Expression )? - -// Precedence by order (see github.com/ethereum/solidity/pull/732) -Expression - = Expression ('++' | '--') - | NewExpression - | IndexAccess - | IndexRangeAccess - | MemberAccess - | FunctionCall - | Expression '{' NameValueList '}' - | '(' Expression ')' - | ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression - | Expression '**' Expression - | Expression ('*' | '/' | '%') Expression - | Expression ('+' | '-') Expression - | Expression ('<<' | '>>') Expression - | Expression '&' Expression - | Expression '^' Expression - | Expression '|' Expression - | Expression ('<' | '>' | '<=' | '>=') Expression - | Expression ('==' | '!=') Expression - | Expression '&&' Expression - | Expression '||' Expression - | Expression '?' Expression ':' Expression - | Expression ('=' | '|=' | '^=' | '&=' | '<<=' | '>>=' | '+=' | '-=' | '*=' | '/=' | '%=') Expression - | PrimaryExpression - -PrimaryExpression = BooleanLiteral - | NumberLiteral - | HexLiteral - | StringLiteral - | TupleExpression - | Identifier - | ElementaryTypeNameExpression - -ExpressionList = Expression ( ',' Expression )* -NameValueList = Identifier ':' Expression ( ',' Identifier ':' Expression )* - -FunctionCall = Expression '(' FunctionCallArguments ')' -FunctionCallArguments = '{' NameValueList? '}' - | ExpressionList? - -NewExpression = 'new' TypeName -MemberAccess = Expression '.' Identifier -IndexAccess = Expression '[' Expression? ']' -IndexRangeAccess = Expression '[' Expression? ':' Expression? ']' - -BooleanLiteral = 'true' | 'false' -NumberLiteral = ( HexNumber | DecimalNumber ) (' ' NumberUnit)? -NumberUnit = 'wei' | 'szabo' | 'finney' | 'ether' - | 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'years' -HexLiteral = 'hex' ('"' ([0-9a-fA-F]{2})* '"' | '\'' ([0-9a-fA-F]{2})* '\'') -StringLiteral = '"' ([^"\r\n\\] | '\\' .)* '"' -Identifier = [a-zA-Z_$] [a-zA-Z_$0-9]* - -HexNumber = '0x' [0-9a-fA-F]+ -DecimalNumber = [0-9]+ ( '.' [0-9]* )? ( [eE] [0-9]+ )? - -TupleExpression = '(' ( Expression? ( ',' Expression? )* )? ')' - | '[' ( Expression ( ',' Expression )* )? ']' - -ElementaryTypeNameExpression = ElementaryTypeName - -ElementaryTypeName = 'address' | 'bool' | 'string' | Int | Uint | Byte | Fixed | Ufixed - -Int = 'int' | 'int8' | 'int16' | 'int24' | 'int32' | 'int40' | 'int48' | 'int56' | 'int64' | 'int72' | 'int80' | 'int88' | 'int96' | 'int104' | 'int112' | 'int120' | 'int128' | 'int136' | 'int144' | 'int152' | 'int160' | 'int168' | 'int176' | 'int184' | 'int192' | 'int200' | 'int208' | 'int216' | 'int224' | 'int232' | 'int240' | 'int248' | 'int256' - -Uint = 'uint' | 'uint8' | 'uint16' | 'uint24' | 'uint32' | 'uint40' | 'uint48' | 'uint56' | 'uint64' | 'uint72' | 'uint80' | 'uint88' | 'uint96' | 'uint104' | 'uint112' | 'uint120' | 'uint128' | 'uint136' | 'uint144' | 'uint152' | 'uint160' | 'uint168' | 'uint176' | 'uint184' | 'uint192' | 'uint200' | 'uint208' | 'uint216' | 'uint224' | 'uint232' | 'uint240' | 'uint248' | 'uint256' - -Byte = 'byte' | 'bytes' | 'bytes1' | 'bytes2' | 'bytes3' | 'bytes4' | 'bytes5' | 'bytes6' | 'bytes7' | 'bytes8' | 'bytes9' | 'bytes10' | 'bytes11' | 'bytes12' | 'bytes13' | 'bytes14' | 'bytes15' | 'bytes16' | 'bytes17' | 'bytes18' | 'bytes19' | 'bytes20' | 'bytes21' | 'bytes22' | 'bytes23' | 'bytes24' | 'bytes25' | 'bytes26' | 'bytes27' | 'bytes28' | 'bytes29' | 'bytes30' | 'bytes31' | 'bytes32' - -Fixed = 'fixed' | ( 'fixed' [0-9]+ 'x' [0-9]+ ) - -Ufixed = 'ufixed' | ( 'ufixed' [0-9]+ 'x' [0-9]+ ) - - -AssemblyBlock = '{' AssemblyStatement* '}' - -AssemblyStatement = AssemblyBlock - | AssemblyFunctionDefinition - | AssemblyVariableDeclaration - | AssemblyAssignment - | AssemblyIf - | AssemblyExpression - | AssemblySwitch - | AssemblyForLoop - | AssemblyBreakContinue - | AssemblyLeave -AssemblyFunctionDefinition = - 'function' Identifier '(' AssemblyIdentifierList? ')' - ( '->' AssemblyIdentifierList )? AssemblyBlock -AssemblyVariableDeclaration = 'let' AssemblyIdentifierList ( ':=' AssemblyExpression )? -AssemblyAssignment = AssemblyIdentifierList ':=' AssemblyExpression -AssemblyExpression = AssemblyFunctionCall | Identifier | Literal -AssemblyIf = 'if' AssemblyExpression AssemblyBlock -AssemblySwitch = 'switch' AssemblyExpression ( AssemblyCase+ AssemblyDefault? | AssemblyDefault ) -AssemblyCase = 'case' Literal AssemblyBlock -AssemblyDefault = 'default' AssemblyBlock -AssemblyForLoop = 'for' AssemblyBlock AssemblyExpression AssemblyBlock AssemblyBlock -AssemblyBreakContinue = 'break' | 'continue' -AssemblyLeave = 'leave' -AssemblyFunctionCall = Identifier '(' ( AssemblyExpression ( ',' AssemblyExpression )* )? ')' - -AssemblyIdentifierList = Identifier ( ',' Identifier )* diff --git a/compiler/docs/grammar/SolidityLexer.g4 b/compiler/docs/grammar/SolidityLexer.g4 new file mode 100644 index 00000000..c47dc411 --- /dev/null +++ b/compiler/docs/grammar/SolidityLexer.g4 @@ -0,0 +1,352 @@ +lexer grammar SolidityLexer; + +/** + * Keywords reserved for future use in Solidity. + */ +ReservedKeywords: + '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'; + +Abstract: 'abstract'; +Address: 'address'; +Anonymous: 'anonymous'; +As: 'as'; +Assembly: 'assembly' -> pushMode(AssemblyBlockMode); +Bool: 'bool'; +Break: 'break'; +Bytes: 'bytes'; +Calldata: 'calldata'; +Catch: 'catch'; +Constant: 'constant'; +Constructor: 'constructor'; +Continue: 'continue'; +Contract: 'contract'; +Delete: 'delete'; +Do: 'do'; +Else: 'else'; +Emit: 'emit'; +Enum: 'enum'; +Error: 'error'; // not a real keyword +Event: 'event'; +External: 'external'; +Fallback: 'fallback'; +False: 'false'; +Fixed: 'fixed' | ('fixed' [1-9][0-9]* 'x' [1-9][0-9]*); +/** + * Bytes types of fixed length. + */ +FixedBytes: + 'bytes1' | 'bytes2' | 'bytes3' | 'bytes4' | 'bytes5' | 'bytes6' | 'bytes7' | 'bytes8' | + 'bytes9' | 'bytes10' | 'bytes11' | 'bytes12' | 'bytes13' | 'bytes14' | 'bytes15' | 'bytes16' | + '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'; +Import: 'import'; +Indexed: 'indexed'; +Interface: 'interface'; +Internal: 'internal'; +Is: 'is'; +Library: 'library'; +Mapping: 'mapping'; +Memory: 'memory'; +Modifier: 'modifier'; +New: 'new'; +/** + * Unit denomination for numbers. + */ +NumberUnit: '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. + */ +SignedIntegerType: + 'int' | 'int8' | 'int16' | 'int24' | 'int32' | 'int40' | 'int48' | 'int56' | 'int64' | + 'int72' | 'int80' | 'int88' | 'int96' | 'int104' | 'int112' | 'int120' | 'int128' | + 'int136' | 'int144' | 'int152' | 'int160' | 'int168' | 'int176' | 'int184' | 'int192' | + 'int200' | 'int208' | 'int216' | 'int224' | 'int232' | 'int240' | 'int248' | 'int256'; +Storage: 'storage'; +String: 'string'; +Struct: 'struct'; +True: 'true'; +Try: 'try'; +Type: 'type'; +Ufixed: 'ufixed' | ('ufixed' [1-9][0-9]+ 'x' [1-9][0-9]+); +Unchecked: 'unchecked'; +/** + * Sized unsigned integer types. + * uint is an alias of uint256. + */ +UnsignedIntegerType: + 'uint' | 'uint8' | 'uint16' | 'uint24' | 'uint32' | 'uint40' | 'uint48' | 'uint56' | 'uint64' | + 'uint72' | 'uint80' | 'uint88' | 'uint96' | 'uint104' | 'uint112' | 'uint120' | 'uint128' | + 'uint136' | 'uint144' | 'uint152' | 'uint160' | 'uint168' | 'uint176' | 'uint184' | 'uint192' | + 'uint200' | 'uint208' | 'uint216' | 'uint224' | 'uint232' | 'uint240' | 'uint248' | 'uint256'; +Using: 'using'; +View: 'view'; +Virtual: 'virtual'; +While: 'while'; + +LParen: '('; +RParen: ')'; +LBrack: '['; +RBrack: ']'; +LBrace: '{'; +RBrace: '}'; +Colon: ':'; +Semicolon: ';'; +Period: '.'; +Conditional: '?'; +DoubleArrow: '=>'; +RightArrow: '->'; + +Assign: '='; +AssignBitOr: '|='; +AssignBitXor: '^='; +AssignBitAnd: '&='; +AssignShl: '<<='; +AssignSar: '>>='; +AssignShr: '>>>='; +AssignAdd: '+='; +AssignSub: '-='; +AssignMul: '*='; +AssignDiv: '/='; +AssignMod: '%='; + +Comma: ','; +Or: '||'; +And: '&&'; +BitOr: '|'; +BitXor: '^'; +BitAnd: '&'; +Shl: '<<'; +Sar: '>>'; +Shr: '>>>'; +Add: '+'; +Sub: '-'; +Mul: '*'; +Div: '/'; +Mod: '%'; +Exp: '**'; + +Equal: '=='; +NotEqual: '!='; +LessThan: '<'; +GreaterThan: '>'; +LessThanOrEqual: '<='; +GreaterThanOrEqual: '>='; +Not: '!'; +BitNot: '~'; +Inc: '++'; +Dec: '--'; +//@doc:inline +DoubleQuote: '"'; +//@doc:inline +SingleQuote: '\''; + +/** + * A non-empty quoted string literal restricted to printable characters. + */ +NonEmptyStringLiteral: '"' DoubleQuotedStringCharacter+ '"' | '\'' SingleQuotedStringCharacter+ '\''; +/** + * An empty string literal + */ +EmptyStringLiteral: '"' '"' | '\'' '\''; + +// Note that this will also be used for Yul string literals. +//@doc:inline +fragment DoubleQuotedStringCharacter: DoubleQuotedPrintable | EscapeSequence; +// Note that this will also be used for Yul string literals. +//@doc:inline +fragment SingleQuotedStringCharacter: SingleQuotedPrintable | EscapeSequence; +/** + * Any printable character except single quote or back slash. + */ +fragment SingleQuotedPrintable: [\u0020-\u0026\u0028-\u005B\u005D-\u007E]; +/** + * Any printable character except double quote or back slash. + */ +fragment DoubleQuotedPrintable: [\u0020-\u0021\u0023-\u005B\u005D-\u007E]; +/** + * Escape sequence. + * Apart from common single character escape sequences, line breaks can be escaped + * as well as four hex digit unicode escapes \\uXXXX and two digit hex escape sequences \\xXX are allowed. + */ +fragment EscapeSequence: + '\\' ( + ['"\\nrt\n\r] + | 'u' HexCharacter HexCharacter HexCharacter HexCharacter + | 'x' HexCharacter HexCharacter + ); +/** + * A single quoted string literal allowing arbitrary unicode characters. + */ +UnicodeStringLiteral: + 'unicode"' DoubleQuotedUnicodeStringCharacter* '"' + | 'unicode\'' SingleQuotedUnicodeStringCharacter* '\''; +//@doc:inline +fragment DoubleQuotedUnicodeStringCharacter: ~["\r\n\\] | EscapeSequence; +//@doc:inline +fragment SingleQuotedUnicodeStringCharacter: ~['\r\n\\] | EscapeSequence; + +// Note that this will also be used for Yul hex string literals. +/** + * Hex strings need to consist of an even number of hex digits that may be grouped using underscores. + */ +HexString: 'hex' (('"' EvenHexDigits? '"') | ('\'' EvenHexDigits? '\'')); +/** + * Hex numbers consist of a prefix and an arbitrary number of hex digits that may be delimited by underscores. + */ +HexNumber: '0' 'x' HexDigits; +//@doc:inline +fragment HexDigits: HexCharacter ('_'? HexCharacter)*; +//@doc:inline +fragment EvenHexDigits: HexCharacter HexCharacter ('_'? HexCharacter HexCharacter)*; +//@doc:inline +fragment HexCharacter: [0-9A-Fa-f]; + +/** + * A decimal number literal consists of decimal digits that may be delimited by underscores and + * an optional positive or negative exponent. + * If the digits contain a decimal point, the literal has fixed point type. + */ +DecimalNumber: (DecimalDigits | (DecimalDigits? '.' DecimalDigits)) ([eE] '-'? DecimalDigits)?; +//@doc:inline +fragment DecimalDigits: [0-9] ('_'? [0-9])* ; + + +/** + * 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. + */ +Identifier: IdentifierStart IdentifierPart*; +//@doc:inline +fragment IdentifierStart: [a-zA-Z$_]; +//@doc:inline +fragment IdentifierPart: [a-zA-Z0-9$_]; + +WS: [ \t\r\n\u000C]+ -> skip ; +COMMENT: '/*' .*? '*/' -> channel(HIDDEN) ; +LINE_COMMENT: '//' ~[\r\n]* -> channel(HIDDEN); + +mode AssemblyBlockMode; + +//@doc:inline +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) ; + +mode YulMode; + +YulBreak: 'break'; +YulCase: 'case'; +YulContinue: 'continue'; +YulDefault: 'default'; +YulFalse: 'false'; +YulFor: 'for'; +YulFunction: 'function'; +YulIf: 'if'; +YulLeave: 'leave'; +YulLet: 'let'; +YulSwitch: 'switch'; +YulTrue: 'true'; +YulHex: 'hex'; + +/** + * Builtin functions in the EVM Yul dialect. + */ +YulEVMBuiltin: + 'stop' | 'add' | 'sub' | 'mul' | 'div' | 'sdiv' | 'mod' | 'smod' | 'exp' | 'not' + | 'lt' | 'gt' | 'slt' | 'sgt' | 'eq' | 'iszero' | 'and' | 'or' | 'xor' | 'byte' + | 'shl' | 'shr' | 'sar' | 'addmod' | 'mulmod' | 'signextend' | 'keccak256' + | 'pop' | 'mload' | 'mstore' | 'mstore8' | 'sload' | 'sstore' | 'msize' | 'gas' + | 'address' | 'balance' | 'selfbalance' | 'caller' | 'callvalue' | 'calldataload' + | 'calldatasize' | 'calldatacopy' | 'extcodesize' | 'extcodecopy' | 'returndatasize' + | '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'; + +YulLBrace: '{' -> pushMode(YulMode); +YulRBrace: '}' -> popMode; +YulLParen: '('; +YulRParen: ')'; +YulAssign: ':='; +YulPeriod: '.'; +YulComma: ','; +YulArrow: '->'; + +/** + * Yul identifiers consist of letters, dollar signs, underscores and numbers, but may not start with a number. + * In inline assembly there cannot be dots in user-defined identifiers. Instead see yulPath for expressions + * consisting of identifiers with dots. + */ +YulIdentifier: YulIdentifierStart YulIdentifierPart*; +//@doc:inline +fragment YulIdentifierStart: [a-zA-Z$_]; +//@doc:inline +fragment YulIdentifierPart: [a-zA-Z0-9$_]; +/** + * Hex literals in Yul consist of a prefix and one or more hexadecimal digits. + */ +YulHexNumber: '0' 'x' [0-9a-fA-F]+; +/** + * Decimal literals in Yul may be zero or any sequence of decimal digits without leading zeroes. + */ +YulDecimalNumber: '0' | ([1-9] [0-9]*); +/** + * String literals in Yul consist of one or more double-quoted or single-quoted strings + * that may contain escape sequences and printable characters except unescaped line breaks or + * unescaped double-quotes or single-quotes, respectively. + */ +YulStringLiteral: + '"' DoubleQuotedStringCharacter* '"' + | '\'' SingleQuotedStringCharacter* '\''; +//@doc:inline +YulHexStringLiteral: HexString; + +YulWS: [ \t\r\n\u000C]+ -> skip ; +YulCOMMENT: '/*' .*? '*/' -> channel(HIDDEN) ; +YulLINE_COMMENT: '//' ~[\r\n]* -> channel(HIDDEN) ; + +mode PragmaMode; + +/** + * Pragma token. Can contain any kind of symbol except a semicolon. + * Note that currently the solidity parser only allows a subset of this. + */ +//@doc:name pragma-token +//@doc:no-diagram +PragmaToken: ~[;]+; +PragmaSemicolon: ';' -> popMode; + +PragmaWS: [ \t\r\n\u000C]+ -> skip ; +PragmaCOMMENT: '/*' .*? '*/' -> channel(HIDDEN) ; +PragmaLINE_COMMENT: '//' ~[\r\n]* -> channel(HIDDEN) ; diff --git a/compiler/docs/grammar/SolidityParser.g4 b/compiler/docs/grammar/SolidityParser.g4 new file mode 100644 index 00000000..92718b97 --- /dev/null +++ b/compiler/docs/grammar/SolidityParser.g4 @@ -0,0 +1,582 @@ +/** + * Solidity is a statically typed, contract-oriented, high-level language for implementing smart contracts on the Ethereum platform. + */ +parser grammar SolidityParser; + +options { tokenVocab=SolidityLexer; } + +/** + * On top level, Solidity allows pragmas, import directives, and + * definitions of contracts, interfaces, libraries, structs, enums and constants. + */ +sourceUnit: ( + pragmaDirective + | importDirective + | usingDirective + | contractDefinition + | interfaceDefinition + | libraryDefinition + | functionDefinition + | constantVariableDeclaration + | structDefinition + | enumDefinition + | userDefinedValueTypeDefinition + | errorDefinition +)* EOF; + +//@doc: inline +pragmaDirective: Pragma PragmaToken+ PragmaSemicolon; + +/** + * Import directives import identifiers from different files. + */ +importDirective: + Import ( + (path (As unitAlias=identifier)?) + | (symbolAliases From path) + | (Mul As unitAlias=identifier From path) + ) Semicolon; +//@doc: inline +//@doc:name aliases +importAliases: symbol=identifier (As alias=identifier)?; +/** + * Path of a file to be imported. + */ +path: NonEmptyStringLiteral; +/** + * List of aliases for symbols to be imported. + */ +symbolAliases: LBrace aliases+=importAliases (Comma aliases+=importAliases)* RBrace; + +/** + * Top-level definition of a contract. + */ +contractDefinition: + Abstract? Contract name=identifier + inheritanceSpecifierList? + LBrace contractBodyElement* RBrace; +/** + * Top-level definition of an interface. + */ +interfaceDefinition: + Interface name=identifier + inheritanceSpecifierList? + LBrace contractBodyElement* RBrace; +/** + * Top-level definition of a library. + */ +libraryDefinition: Library name=identifier LBrace contractBodyElement* RBrace; + +//@doc:inline +inheritanceSpecifierList: + Is inheritanceSpecifiers+=inheritanceSpecifier + (Comma inheritanceSpecifiers+=inheritanceSpecifier)*?; +/** + * Inheritance specifier for contracts and interfaces. + * Can optionally supply base constructor arguments. + */ +inheritanceSpecifier: name=identifierPath arguments=callArgumentList?; + +/** + * Declarations that can be used in contracts, interfaces and libraries. + * + * Note that interfaces and libraries may not contain constructors, interfaces may not contain state variables + * and libraries may not contain fallback, receive functions nor non-constant state variables. + */ +contractBodyElement: + constructorDefinition + | functionDefinition + | modifierDefinition + | fallbackFunctionDefinition + | receiveFunctionDefinition + | structDefinition + | enumDefinition + | userDefinedValueTypeDefinition + | stateVariableDeclaration + | eventDefinition + | errorDefinition + | usingDirective; +//@doc:inline +namedArgument: name=identifier Colon value=expression; +/** + * Arguments when calling a function or a similar callable object. + * The arguments are either given as comma separated list or as map of named arguments. + */ +callArgumentList: LParen ((expression (Comma expression)*)? | LBrace (namedArgument (Comma namedArgument)*)? RBrace) RParen; +/** + * Qualified name. + */ +identifierPath: identifier (Period identifier)*; + +/** + * Call to a modifier. If the modifier takes no arguments, the argument list can be skipped entirely + * (including opening and closing parentheses). + */ +modifierInvocation: identifierPath callArgumentList?; +/** + * Visibility for functions and function types. + */ +visibility: Internal | External | Private | Public; +/** + * A list of parameters, such as function arguments or return values. + */ +parameterList: parameters+=parameterDeclaration (Comma parameters+=parameterDeclaration)*; +//@doc:inline +parameterDeclaration: type=typeName location=dataLocation? name=identifier?; +/** + * Definition of a constructor. + * Must always supply an implementation. + * Note that specifying internal or public visibility is deprecated. + */ +constructorDefinition +locals[boolean payableSet = false, boolean visibilitySet = false] +: + Constructor LParen (arguments=parameterList)? RParen + ( + modifierInvocation + | {!$payableSet}? Payable {$payableSet = true;} + | {!$visibilitySet}? Internal {$visibilitySet = true;} + | {!$visibilitySet}? Public {$visibilitySet = true;} + )* + body=block; + +/** + * State mutability for function types. + * The default mutability 'non-payable' is assumed if no mutability is specified. + */ +stateMutability: Pure | View | Payable; +/** + * An override specifier used for functions, modifiers or state variables. + * In cases where there are ambiguous declarations in several base contracts being overridden, + * a complete list of base contracts has to be given. + */ +overrideSpecifier: Override (LParen overrides+=identifierPath (Comma overrides+=identifierPath)* RParen)?; +/** + * The definition of contract, library and interface 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. + */ +functionDefinition +locals[ + boolean visibilitySet = false, + boolean mutabilitySet = false, + boolean virtualSet = false, + boolean overrideSpecifierSet = false +] +: + Function (identifier | Fallback | Receive) + LParen (arguments=parameterList)? RParen + ( + {!$visibilitySet}? visibility {$visibilitySet = true;} + | {!$mutabilitySet}? stateMutability {$mutabilitySet = true;} + | modifierInvocation + | {!$virtualSet}? Virtual {$virtualSet = true;} + | {!$overrideSpecifierSet}? overrideSpecifier {$overrideSpecifierSet = true;} + )* + (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, + * but is used as placeholder statement for the body of a function to which the modifier is applied. + */ +modifierDefinition +locals[ + boolean virtualSet = false, + boolean overrideSpecifierSet = false +] +: + Modifier name=identifier + (LParen (arguments=parameterList)? RParen)? + ( + {!$virtualSet}? Virtual {$virtualSet = true;} + | {!$overrideSpecifierSet}? overrideSpecifier {$overrideSpecifierSet = true;} + )* + (Semicolon | body=block); + +/** + * Definition of the special fallback function. + */ +fallbackFunctionDefinition +locals[ + boolean visibilitySet = false, + boolean mutabilitySet = false, + boolean virtualSet = false, + boolean overrideSpecifierSet = false, + boolean hasParameters = false +] +: + kind=Fallback LParen (parameterList { $hasParameters = true; } )? RParen + ( + {!$visibilitySet}? External {$visibilitySet = true;} + | {!$mutabilitySet}? stateMutability {$mutabilitySet = true;} + | modifierInvocation + | {!$virtualSet}? Virtual {$virtualSet = true;} + | {!$overrideSpecifierSet}? overrideSpecifier {$overrideSpecifierSet = true;} + )* + ( {$hasParameters}? Returns LParen returnParameters=parameterList RParen | {!$hasParameters}? ) + (Semicolon | body=block); + +/** + * Definition of the special receive function. + */ +receiveFunctionDefinition +locals[ + boolean visibilitySet = false, + boolean mutabilitySet = false, + boolean virtualSet = false, + boolean overrideSpecifierSet = false +] +: + kind=Receive LParen RParen + ( + {!$visibilitySet}? External {$visibilitySet = true;} + | {!$mutabilitySet}? Payable {$mutabilitySet = true;} + | modifierInvocation + | {!$virtualSet}? Virtual {$virtualSet = true;} + | {!$overrideSpecifierSet}? overrideSpecifier {$overrideSpecifierSet = true;} + )* + (Semicolon | body=block); + +/** + * Definition of a struct. Can occur at top-level within a source unit or within a contract, library or interface. + */ +structDefinition: Struct name=identifier LBrace members=structMember+ RBrace; +/** + * The declaration of a named struct member. + */ +structMember: type=typeName name=identifier Semicolon; +/** + * Definition of an enum. Can occur at top-level within a source unit or within a contract, library or interface. + */ +enumDefinition: Enum name=identifier LBrace enumValues+=identifier (Comma enumValues+=identifier)* RBrace; +/** + * Definition of a user defined value type. Can occur at top-level within a source unit or within a contract, library or interface. + */ +userDefinedValueTypeDefinition: + Type name=identifier Is elementaryTypeName[true] Semicolon; + +/** + * The declaration of a state variable. + */ +stateVariableDeclaration +locals [boolean constantnessSet = false, boolean visibilitySet = false, boolean overrideSpecifierSet = false] +: + type=typeName + ( + {!$visibilitySet}? Public {$visibilitySet = true;} + | {!$visibilitySet}? Private {$visibilitySet = true;} + | {!$visibilitySet}? Internal {$visibilitySet = true;} + | {!$constantnessSet}? Constant {$constantnessSet = true;} + | {!$overrideSpecifierSet}? overrideSpecifier {$overrideSpecifierSet = true;} + | {!$constantnessSet}? Immutable {$constantnessSet = true;} + )* + name=identifier + (Assign initialValue=expression)? + Semicolon; + +/** + * The declaration of a constant variable. + */ +constantVariableDeclaration +: + type=typeName + Constant + name=identifier + Assign initialValue=expression + Semicolon; + +/** + * Parameter of an event. + */ +eventParameter: type=typeName Indexed? name=identifier?; +/** + * Definition of an event. Can occur in contracts, libraries or interfaces. + */ +eventDefinition: + Event name=identifier + LParen (parameters+=eventParameter (Comma parameters+=eventParameter)*)? RParen + Anonymous? + Semicolon; + +/** + * Parameter of an error. + */ +errorParameter: type=typeName name=identifier?; +/** + * Definition of an error. + */ +errorDefinition: + Error name=identifier + LParen (parameters+=errorParameter (Comma parameters+=errorParameter)*)? RParen + Semicolon; + +/** + * Using directive to bind library functions and free functions to types. + * Can occur within contracts and libraries and at the file level. + */ +usingDirective: Using (identifierPath | (LBrace identifierPath (Comma identifierPath)* 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. + */ +typeName: elementaryTypeName[true] | functionTypeName | mappingType | identifierPath | typeName LBrack expression? RBrack; +elementaryTypeName[boolean allowAddressPayable]: Address | {$allowAddressPayable}? Address Payable | Bool | String | Bytes | SignedIntegerType | UnsignedIntegerType | FixedBytes | Fixed | Ufixed; +functionTypeName +locals [boolean visibilitySet = false, boolean mutabilitySet = false] +: + Function LParen (arguments=parameterList)? RParen + ( + {!$visibilitySet}? visibility {$visibilitySet = true;} + | {!$mutabilitySet}? stateMutability {$mutabilitySet = true;} + )* + (Returns LParen returnParameters=parameterList RParen)?; + +/** + * The declaration of a single variable. + */ +variableDeclaration: type=typeName location=dataLocation? name=identifier; +dataLocation: Memory | Storage | Calldata; + +/** + * Complex expression. + * Can be an index access, an index range access, a member access, a function call (with optional function call options), + * a type conversion, an unary or binary expression, a comparison or assignment, a ternary expression, + * a new-expression (i.e. a contract creation or the allocation of a dynamic memory array), + * a tuple, an inline array or a primary expression (i.e. an identifier, literal or type name). + */ +expression: + expression LBrack index=expression? RBrack # IndexAccess + | expression LBrack start=expression? Colon end=expression? RBrack # IndexRangeAccess + | expression Period (identifier | Address) # MemberAccess + | expression LBrace (namedArgument (Comma namedArgument)*)? RBrace # FunctionCallOptions + | expression callArgumentList # FunctionCall + | Payable callArgumentList # PayableConversion + | Type LParen typeName RParen # MetaType + | (Inc | Dec | Not | BitNot | Delete | Sub) expression # UnaryPrefixOperation + | expression (Inc | Dec) # UnarySuffixOperation + | expression Exp expression # ExpOperation + | expression (Mul | Div | Mod) expression # MulDivModOperation + | expression (Add | Sub) expression # AddSubOperation + | expression (Shl | Sar | Shr) expression # ShiftOperation + | expression BitAnd expression # BitAndOperation + | expression BitXor expression # BitXorOperation + | expression BitOr expression # BitOrOperation + | expression (LessThan | GreaterThan | LessThanOrEqual | GreaterThanOrEqual) expression # OrderComparison + | expression (Equal | NotEqual) expression # EqualityComparison + | expression And expression # AndOperation + | expression Or expression # OrOperation + | expression Conditional expression Colon expression # Conditional + | expression assignOp expression # Assignment + | New typeName # NewExpression + | tupleExpression # Tuple + | inlineArrayExpression # InlineArray + | ( + identifier + | literal + | elementaryTypeName[false] + ) # PrimaryExpression +; + +//@doc:inline +assignOp: Assign | AssignBitOr | AssignBitXor | AssignBitAnd | AssignShl | AssignSar | AssignShr | AssignAdd | AssignSub | AssignMul | AssignDiv | AssignMod; +tupleExpression: LParen (expression? ( Comma expression?)* ) RParen; +/** + * An inline array expression denotes a statically sized array of the common type of the contained expressions. + */ +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 | Global; + +literal: stringLiteral | numberLiteral | booleanLiteral | hexStringLiteral | unicodeStringLiteral; +booleanLiteral: True | False; +/** + * A full string literal consists of either one or several consecutive quoted strings. + */ +stringLiteral: (NonEmptyStringLiteral | EmptyStringLiteral)+; +/** + * A full hex string literal that consists of either one or several consecutive hex strings. + */ +hexStringLiteral: HexString+; +/** + * A full unicode string literal that consists of either one or several consecutive unicode strings. + */ +unicodeStringLiteral: UnicodeStringLiteral+; + +/** + * Number literals can be decimal or hexadecimal numbers with an optional unit. + */ +numberLiteral: (DecimalNumber | HexNumber) NumberUnit?; +/** + * A curly-braced block of statements. Opens its own scope. + */ +block: + LBrace ( statement | uncheckedBlock )* RBrace; + +uncheckedBlock: Unchecked block; + +statement: + block + | simpleStatement + | ifStatement + | forStatement + | whileStatement + | doWhileStatement + | continueStatement + | breakStatement + | tryStatement + | returnStatement + | emitStatement + | revertStatement + | assemblyStatement +; + +//@doc:inline +simpleStatement: variableDeclarationStatement | expressionStatement; +/** + * If statement with optional else part. + */ +ifStatement: If LParen expression RParen statement (Else statement)?; +/** + * For statement with optional init, condition and post-loop part. + */ +forStatement: For LParen (simpleStatement | Semicolon) (expressionStatement | Semicolon) expression? RParen statement; +whileStatement: While LParen expression RParen statement; +doWhileStatement: Do statement While LParen expression RParen Semicolon; +/** + * A continue statement. Only allowed inside for, while or do-while loops. + */ +continueStatement: Continue Semicolon; +/** + * A break statement. Only allowed inside for, while or do-while loops. + */ +breakStatement: Break Semicolon; +/** + * A try statement. The contained expression needs to be an external function call or a contract creation. + */ +tryStatement: Try expression (Returns LParen returnParameters=parameterList RParen)? block catchClause+; +/** + * The catch clause of a try statement. + */ +catchClause: Catch (identifier? LParen (arguments=parameterList) RParen)? block; + +returnStatement: Return expression? Semicolon; +/** + * An emit statement. The contained expression needs to refer to an event. + */ +emitStatement: Emit expression callArgumentList Semicolon; +/** + * A revert statement. The contained expression needs to refer to an error. + */ +revertStatement: Revert expression callArgumentList Semicolon; +/** + * An inline assembly block. + * 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? 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)*; +/** + * A tuple of variable names to be used in variable declarations. + * May contain empty fields. + */ +variableDeclarationTuple: + LParen + (Comma* variableDeclarations+=variableDeclaration) + (Comma (variableDeclarations+=variableDeclaration)?)* + RParen; +/** + * A variable declaration statement. + * A single variable may be declared without initial value, whereas a tuple of variables can only be + * declared with initial value. + */ +variableDeclarationStatement: ((variableDeclaration (Assign expression)?) | (variableDeclarationTuple Assign expression)) Semicolon; +expressionStatement: expression Semicolon; + +mappingType: Mapping LParen key=mappingKeyType DoubleArrow value=typeName RParen; +/** + * Only elementary types or user defined types are viable as mapping keys. + */ +mappingKeyType: elementaryTypeName[false] | identifierPath; + +/** + * A Yul statement within an inline assembly block. + * continue and break statements are only valid within for loops. + * leave statements are only valid within function bodies. + */ +yulStatement: + yulBlock + | yulVariableDeclaration + | yulAssignment + | yulFunctionCall + | yulIfStatement + | yulForStatement + | yulSwitchStatement + | YulLeave + | YulBreak + | YulContinue + | yulFunctionDefinition; + +yulBlock: YulLBrace yulStatement* YulRBrace; + +/** + * The declaration of one or more Yul variables with optional initial value. + * If multiple variables are declared, only a function call is a valid initial value. + */ +yulVariableDeclaration: + (YulLet variables+=YulIdentifier (YulAssign yulExpression)?) + | (YulLet variables+=YulIdentifier (YulComma variables+=YulIdentifier)* (YulAssign yulFunctionCall)?); + +/** + * Any expression can be assigned to a single Yul variable, whereas + * multi-assignments require a function call on the right-hand side. + */ +yulAssignment: yulPath YulAssign yulExpression | (yulPath (YulComma yulPath)+) YulAssign yulFunctionCall; + +yulIfStatement: YulIf cond=yulExpression body=yulBlock; + +yulForStatement: YulFor init=yulBlock cond=yulExpression post=yulBlock body=yulBlock; + +//@doc:inline +yulSwitchCase: YulCase yulLiteral yulBlock; +/** + * A Yul switch statement can consist of only a default-case (deprecated) or + * one or more non-default cases optionally followed by a default-case. + */ +yulSwitchStatement: + YulSwitch yulExpression + ( + (yulSwitchCase+ (YulDefault yulBlock)?) + | (YulDefault yulBlock) + ); + +yulFunctionDefinition: + YulFunction YulIdentifier + YulLParen (arguments+=YulIdentifier (YulComma arguments+=YulIdentifier)*)? YulRParen + (YulArrow returnParameters+=YulIdentifier (YulComma returnParameters+=YulIdentifier)*)? + body=yulBlock; + +/** + * While only identifiers without dots can be declared within inline assembly, + * paths containing dots can refer to declarations outside the inline assembly block. + */ +yulPath: YulIdentifier (YulPeriod (YulIdentifier | YulEVMBuiltin))*; +/** + * A call to a function with return values can only occur as right-hand side of an assignment or + * a variable declaration. + */ +yulFunctionCall: (YulIdentifier | YulEVMBuiltin) YulLParen (yulExpression (YulComma yulExpression)*)? YulRParen; +yulBoolean: YulTrue | YulFalse; +yulLiteral: YulDecimalNumber | YulStringLiteral | YulHexNumber | yulBoolean | YulHexStringLiteral; +yulExpression: yulPath | yulFunctionCall | yulLiteral; diff --git a/compiler/docs/index.rst b/compiler/docs/index.rst index 6610b521..7576b363 100644 --- a/compiler/docs/index.rst +++ b/compiler/docs/index.rst @@ -1,17 +1,12 @@ Solidity ======== -.. image:: logo.svg - :width: 120px - :alt: Solidity logo - :align: center - 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 was influenced by C++, Python and JavaScript and is designed to target -the Ethereum Virtual Machine (EVM). +Solidity is a `curly-bracket language `_ 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 ` section. Solidity is statically typed, supports inheritance, libraries and complex user-defined types among other features. @@ -20,66 +15,98 @@ With Solidity you can create contracts for uses such as voting, crowdfunding, bl and multi-signature wallets. 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 introduced regularly. We currently use -a 0.x version number `to indicate this fast pace of change `_. +version of Solidity. Apart from exceptional cases, only the latest version receives +`security fixes `_. +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 `_. .. warning:: - Solidity recently released the 0.6.x version that introduced a lot of breaking - changes. Make sure you read :doc:`the full list <060-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 ` 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. + + +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: -Language Documentation ----------------------- +* :ref:`A simple example smart contract ` written in Solidity. +* :ref:`Blockchain Basics `. +* :ref:`The Ethereum Virtual Machine `. -If you are new to the concept of smart contracts we recommend you start with -:ref:`an example smart contract ` written -in Solidity. When you are ready for more detail, we recommend you read the -:doc:`"Solidity by Example" ` and -:doc:`"Solidity in Depth" ` sections to learn the core concepts of the language. +**2. Get to Know Solidity** -For further reading, try :ref:`the basics of blockchains ` -and details of the :ref:`Ethereum Virtual Machine `. +Once you are accustomed to the basics, we recommend you read the :doc:`"Solidity by Example" ` +and “Language Description” sections to understand the core concepts of the language. + +**3. Install the Solidity Compiler** + +There are various ways to install the Solidity compiler, +simply choose your preferred option and follow the steps outlined on the :ref:`installation page `. .. hint:: - You can always try out code examples in your browser with the + You can try out code examples directly in your browser with the `Remix IDE `_. Remix is a web browser based IDE - that allows you to write Solidity smart contracts, then deploy and run the - smart contracts. It can take a while to load, so please be patient. + 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 + 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. -If you have any questions, you can try searching for answers or asking on the -`Ethereum Stackexchange `_, or -our `gitter channel `_. +**4. Learn More** -Ideas for improving Solidity or this documentation are always welcome, -read our :doc:`contributors guide ` for more details. +If you want to learn more about building decentralized applications on Ethereum, the +`Ethereum Developer Resources `_ +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 `_, or +our `Gitter channel `_. .. _translations: Translations ------------ -Community volunteers help translate this documentation into several languages. -They have varying degrees of completeness and up-to-dateness. The English +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. -* `French `_ (in progress) -* `Italian `_ (in progress) -* `Japanese `_ -* `Korean `_ (in progress) -* `Russian `_ (rather outdated) -* `Simplified Chinese `_ (in progress) -* `Spanish `_ -* `Turkish `_ (partial) +You can switch between languages by clicking on the flyout menu in the bottom-left corner +and selecting the preferred language. + +* `French `_ +* `Indonesian `_ +* `Persian `_ +* `Japanese `_ +* `Korean `_ +* `Chinese `_ + +.. note:: + + We recently set up a new GitHub organization and translation workflow to help streamline the + community efforts. Please refer to the `translation guide `_ + for information on how to start a new language or contribute to the community translations. Contents ======== @@ -88,19 +115,64 @@ Contents .. toctree:: :maxdepth: 2 + :caption: Basics introduction-to-smart-contracts.rst installing-solidity.rst solidity-by-example.rst - solidity-in-depth.rst - natspec-format.rst - security-considerations.rst - resources.rst + +.. toctree:: + :maxdepth: 2 + :caption: Language Description + + layout-of-source-files.rst + structure-of-a-contract.rst + types.rst + units-and-global-variables.rst + control-structures.rst + contracts.rst + assembly.rst + cheatsheet.rst + grammar.rst + +.. toctree:: + :maxdepth: 2 + :caption: Compiler + using-the-compiler.rst + analysing-compilation-output.rst + ir-breaking-changes.rst + +.. toctree:: + :maxdepth: 2 + :caption: Internals + + internals/layout_in_storage.rst + internals/layout_in_memory.rst + internals/layout_in_calldata.rst + internals/variable_cleanup.rst + internals/source_mappings.rst + internals/optimizer.rst metadata.rst abi-spec.rst + +.. toctree:: + :maxdepth: 2 + :caption: Additional Material + + 050-breaking-changes.rst + 060-breaking-changes.rst + 070-breaking-changes.rst + 080-breaking-changes.rst + natspec-format.rst + security-considerations.rst + smtchecker.rst + resources.rst + path-resolution.rst yul.rst style-guide.rst common-patterns.rst bugs.rst contributing.rst + brand-guide.rst + language-influences.rst diff --git a/compiler/docs/installing-solidity.rst b/compiler/docs/installing-solidity.rst index d02651a2..9a613d75 100644 --- a/compiler/docs/installing-solidity.rst +++ b/compiler/docs/installing-solidity.rst @@ -9,11 +9,22 @@ Installing the Solidity Compiler Versioning ========== -Solidity versions follow `semantic versioning `_ and in addition to -releases, **nightly development builds** are also made available. The nightly builds -are not guaranteed to be working and despite best efforts they might contain undocumented -and/or broken changes. We recommend using the latest release. Package installers below -will use the latest release. +Solidity versions follow `Semantic Versioning `_. In +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 +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 +contain undocumented and/or broken changes that will not become a part of an +actual release. They are not meant for production use. + +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 introduced regularly. +We currently use a 0.x version number `to indicate this fast pace of change `_. Remix ===== @@ -35,11 +46,11 @@ or if you require more compilation options. npm / Node.js ============= -Use `npm` for a convenient and portable way to install `solcjs`, a Solidity compiler. The +Use ``npm`` for a convenient and portable way to install ``solcjs``, a Solidity compiler. The `solcjs` program has fewer features than the ways to access the compiler described further down this page. The :ref:`commandline-compiler` documentation assumes you are using -the full-featured compiler, `solc`. The usage of `solcjs` is documented inside its own +the full-featured compiler, ``solc``. The usage of ``solcjs`` is documented inside its own `repository `_. Note: The solc-js project is derived from the C++ @@ -53,10 +64,10 @@ Please refer to the solc-js repository for instructions. .. note:: - The commandline executable is named `solcjs`. + The commandline executable is named ``solcjs``. - The comandline options of `solcjs` are not compatible with `solc` and tools (such as `geth`) - expecting the behaviour of `solc` will not work with `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``. Docker ====== @@ -86,14 +97,16 @@ 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. +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 `). .. code-block:: bash docker run ethereum/solc:stable --standard-json < input.json > output.json -Binary Packages -=============== +Linux Packages +============== Binary packages of Solidity are available at `solidity/releases `_. @@ -116,8 +129,17 @@ The nightly version can be installed using these commands: sudo apt-get update sudo apt-get install solc -We are also releasing a `snap package `_, which is -installable in all the `supported Linux distros `_. To +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. + +For example, Arch Linux has packages for the latest development version: + +.. code-block:: bash + + pacman -S solidity + +There is also a `snap package `_, however, it is **currently unmaintained**. +It is installable in all the `supported Linux distros `_. To install the latest stable version of solc: .. code-block:: bash @@ -137,11 +159,9 @@ with the most recent changes, please use the following: but it comes with limitations, like accessing only the files in your ``/home`` and ``/media`` directories. For more information, go to `Demystifying Snap Confinement `_. -Arch Linux also has packages, albeit limited to the latest development version: - -.. code-block:: bash - pacman -S solidity +macOS Packages +============== We distribute the Solidity compiler through Homebrew as a build-from-source version. Pre-built bottles are @@ -163,8 +183,13 @@ Homebrew formula directly from Github. View `solidity.rb commits on Github `_. -Follow the history links until you have a raw file link of a -specific commit of ``solidity.rb``. +Copy the commit hash of the version you want and check it out on your machine. + +.. code-block:: bash + + git clone https://github.com/ethereum/homebrew-ethereum.git + cd homebrew-ethereum + git checkout Install it using ``brew``: @@ -172,14 +197,114 @@ Install it using ``brew``: brew unlink solidity # eg. Install 0.4.8 - brew install https://raw.githubusercontent.com/ethereum/homebrew-ethereum/77cce03da9f289e5a3ffe579840d3c5dc0a62717/solidity.rb + brew install solidity.rb -Gentoo Linux has an `Ethereum overlay `_ that contains a solidity package. -After the overlay is setup, ``solc`` can be installed in x86_64 architectures by: +Static Binaries +=============== -.. code-block:: bash +We maintain a repository containing static builds of past and current compiler versions for all +supported platforms at `solc-bin`_. This is also the location where you can find the nightly builds. + +The repository is not only a quick and easy way for end users to get binaries ready to be used +out-of-the-box but it is also meant to be friendly to third-party tools: + +- The content is mirrored to https://binaries.soliditylang.org where it can be easily downloaded over + 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 + bundled with necessary DLLs). +- We strive for a high level of backwards-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. +- 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. + +The same binaries are in most cases available on the `Solidity release page on Github`_. The +difference is that we do not generally update old releases on the Github release page. This means +that we do not rename them if the naming convention changes and we do not add builds for platforms +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 +``emscripten-wasm32/list.json`` you will find the following information about version 0.7.4: + +.. code-block:: json + + { + "path": "solc-emscripten-wasm32-v0.7.4+commit.3f05b770.js", + "version": "0.7.4", + "build": "commit.3f05b770", + "longVersion": "0.7.4+commit.3f05b770", + "keccak256": "0x300330ecd127756b824aa13e843cb1f43c473cb22eaf3750d5fb9c99279af8c3", + "sha256": "0x2b55ed5fec4d9625b6c7b3ab1abd2b7fb7dd2a9c68543bf0323db2c7e2d55af2", + "urls": [ + "bzzr://16c5f09109c793db99fe35f037c6092b061bd39260ee7a677c8a97f18c955ab1", + "dweb:/ipfs/QmTLs5MuLEWXQkths41HiACoXDiH8zxyqBHGFDRSzVE5CS" + ] + } + +This means that: + +- You can find the binary in the same directory under the name + `solc-emscripten-wasm32-v0.7.4+commit.3f05b770.js `_. + Note that the file might be a symlink, and you will need to resolve it yourself if you are not using + git to download it or your file system does not support symlinks. +- The binary is also mirrored at https://binaries.soliditylang.org/emscripten-wasm32/solc-emscripten-wasm32-v0.7.4+commit.3f05b770.js. + In this case git is not necessary and symlinks are resolved transparently, either by serving a copy + of the file or returning a HTTP redirect. +- The file is also available on IPFS at `QmTLs5MuLEWXQkths41HiACoXDiH8zxyqBHGFDRSzVE5CS`_. +- 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 + from ethereumjs-util`_ in JavaScript. +- You can also verify the integrity of the binary by comparing its sha256 hash to + ``0x2b55ed5fec4d9625b6c7b3ab1abd2b7fb7dd2a9c68543bf0323db2c7e2d55af2``. + +.. warning:: + + Due to the strong backwards compatibility requirement the repository contains some legacy elements + but you should avoid using them when writing new tools: + + - Use ``emscripten-wasm32/`` (with a fallback to ``emscripten-asmjs/``) instead of ``bin/`` if + you want the best performance. Until version 0.6.1 we only provided asm.js binaries. + Starting with 0.6.2 we switched to `WebAssembly builds`_ with much better performance. We have + rebuilt the older versions for wasm but the original asm.js files remain in ``bin/``. + The new ones had to be placed in a separate directory to avoid name clashes. + - Use ``emscripten-asmjs/`` and ``emscripten-wasm32/`` instead of ``bin/`` and ``wasm/`` directories + if you want to be sure whether you are downloading a wasm or an asm.js binary. + - Use ``list.json`` instead of ``list.js`` and ``list.txt``. The JSON list format contains all + the information from the old ones and more. + - Use https://binaries.soliditylang.org instead of https://solc-bin.ethereum.org. To keep things + simple we moved almost everything related to the compiler under the new ``soliditylang.org`` + domain and this applies to ``solc-bin`` too. While the new domain is recommended, the old one + is still fully supported and guaranteed to point at the same location. - emerge dev-lang/solidity +.. warning:: + + The binaries are also available at https://ethereum.github.io/solc-bin/ but this page + stopped being updated just after the release of version 0.7.2, will not receive any new releases + or nightly builds for any platform and does not serve the new directory structure, including + non-emscripten builds. + + If you are using it, please switch to https://binaries.soliditylang.org, which is a drop-in + replacement. This allows us to make changes to the underlying hosting in a transparent way and + minimize disruption. Unlike the ``ethereum.github.io`` domain, which we do not have any control + over, ``binaries.soliditylang.org`` is guaranteed to work and maintain the same URL structure + in the long-term. + +.. _IPFS: https://ipfs.io +.. _Swarm: https://swarm-gateways.net/bzz:/swarm.eth +.. _solc-bin: https://github.com/ethereum/solc-bin/ +.. _Solidity release page on github: https://github.com/ethereum/solidity/releases +.. _sha3sum: https://github.com/maandree/sha3sum +.. _keccak256() function from ethereumjs-util: https://github.com/ethereumjs/ethereumjs-util/blob/master/docs/modules/_hash_.md#const-keccak256 +.. _WebAssembly builds: https://emscripten.org/docs/compiling/WebAssembly.html +.. _QmTLs5MuLEWXQkths41HiACoXDiH8zxyqBHGFDRSzVE5CS: https://gateway.ipfs.io/ipfs/QmTLs5MuLEWXQkths41HiACoXDiH8zxyqBHGFDRSzVE5CS +.. _16c5f09109c793db99fe35f037c6092b061bd39260ee7a677c8a97f18c955ab1: https://swarm-gateways.net/bzz:/16c5f09109c793db99fe35f037c6092b061bd39260ee7a677c8a97f18c955ab1/ .. _building-from-source: @@ -194,18 +319,19 @@ The following are dependencies for all builds of Solidity: +-----------------------------------+-------------------------------------------------------+ | Software | Notes | +===================================+=======================================================+ -| `CMake`_ (version 3.9+) | Cross-platform build file generator. | +| `CMake`_ (version 3.13+) | Cross-platform build file generator. | +-----------------------------------+-------------------------------------------------------+ -| `Boost`_ (version 1.65+) | C++ libraries. | +| `Boost`_ (version 1.77+ on | C++ libraries. | +| Windows, 1.65+ otherwise) | | +-----------------------------------+-------------------------------------------------------+ | `Git`_ | Command-line tool for retrieving source code. | +-----------------------------------+-------------------------------------------------------+ -| `z3`_ (version 4.6+, Optional) | For use with SMT checker. | +| `z3`_ (version 4.8+, Optional) | For use with SMT checker. | +-----------------------------------+-------------------------------------------------------+ | `cvc4`_ (Optional) | For use with SMT checker. | +-----------------------------------+-------------------------------------------------------+ -.. _cvc4: http://cvc4.cs.stanford.edu/web/ +.. _cvc4: https://cvc4.cs.stanford.edu/web/ .. _Git: https://git-scm.com/download .. _Boost: https://www.boost.org .. _CMake: https://cmake.org/download/ @@ -218,14 +344,35 @@ The following are dependencies for all builds of Solidity: Starting from 0.5.10 linking against Boost 1.70+ should work without manual intervention. -Minimum compiler versions +.. note:: + The default build configuration requires a specific Z3 version (the latest one at the time the + code was last updated). Changes introduced between Z3 releases often result in slightly different + (but still valid) results being returned. Our SMT tests do not account for these differences and + will likely fail with a different version than the one they were written for. This does not mean + that a build using a different version is faulty. If you pass ``-DSTRICT_Z3_VERSION=OFF`` option + to CMake, you can build with any version that satisfies the requirement given in the table above. + 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 `_. + +Minimum Compiler Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ The following C++ compilers and their minimum versions can build the Solidity codebase: -- `GCC `_, version 5+ -- `Clang `_, version 3.4+ -- `MSVC `_, version 2017+ +- `GCC `_, version 8+ +- `Clang `_, version 7+ +- `MSVC `_, version 2019+ Prerequisites - macOS --------------------- @@ -234,7 +381,7 @@ For macOS builds, ensure that you have the latest version of `Xcode installed `_. This contains the `Clang C++ compiler `_, the `Xcode IDE `_ and other Apple development -tools which are required for building C++ applications on OS X. +tools that are required for building C++ applications on OS X. If you are installing Xcode for the first time, or have just installed a new version then you will need to agree to the license before you can do command-line builds: @@ -243,10 +390,10 @@ command-line builds: sudo xcodebuild -license accept -Our OS X build script uses `the Homebrew `_ +Our OS X build script uses `the Homebrew `_ package manager for installing external dependencies. Here's how to `uninstall Homebrew -`_, +`_, if you ever want to start again from scratch. Prerequisites - Windows @@ -257,45 +404,39 @@ You need to install the following dependencies for Windows builds of Solidity: +-----------------------------------+-------------------------------------------------------+ | Software | Notes | +===================================+=======================================================+ -| `Visual Studio 2017 Build Tools`_ | C++ compiler | +| `Visual Studio 2019 Build Tools`_ | C++ compiler | +-----------------------------------+-------------------------------------------------------+ -| `Visual Studio 2017`_ (Optional) | C++ compiler and dev environment. | +| `Visual Studio 2019`_ (Optional) | C++ compiler and dev environment. | ++-----------------------------------+-------------------------------------------------------+ +| `Boost`_ (version 1.77+) | C++ libraries. | +-----------------------------------+-------------------------------------------------------+ If you already have one IDE and only need the compiler and libraries, -you could install Visual Studio 2017 Build Tools. +you could install Visual Studio 2019 Build Tools. -Visual Studio 2017 provides both IDE and necessary compiler and libraries. -So if you have not got an IDE and prefer to develop solidity, Visual Studio 2017 +Visual Studio 2019 provides both IDE and necessary compiler and libraries. +So if you have not got an IDE and prefer to develop Solidity, Visual Studio 2019 may be a choice for you to get everything setup easily. Here is the list of components that should be installed -in Visual Studio 2017 Build Tools or Visual Studio 2017: +in Visual Studio 2019 Build Tools or Visual Studio 2019: * Visual Studio C++ core features -* VC++ 2017 v141 toolset (x86,x64) +* VC++ 2019 v141 toolset (x86,x64) * Windows Universal CRT SDK * Windows 8.1 SDK * C++/CLI support -.. _Visual Studio 2017: https://www.visualstudio.com/vs/ -.. _Visual Studio 2017 Build Tools: https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017 - -Dependencies Helper Script --------------------------- - -We have a helper script which you can use to install all required external dependencies -on macOS, Windows and on numerous Linux distros. - -.. code-block:: bash - - ./scripts/install_deps.sh +.. _Visual Studio 2019: https://www.visualstudio.com/vs/ +.. _Visual Studio 2019 Build Tools: https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2019 -Or, on Windows: +We have a helper script which you can use to install all required external dependencies: .. code-block:: bat - scripts\install_deps.bat + scripts\install_deps.ps1 + +This will install ``boost`` and ``cmake`` to the ``deps`` subdirectory. Clone the Repository -------------------- @@ -314,16 +455,28 @@ 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 + 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: + + https://github.com/ethereum/solidity/releases/download/v0.X.Y/solidity_0.X.Y.tar.gz + + (not the "Source code" provided by github). + Command-Line Build ------------------ **Be sure to install External Dependencies (see above) before build.** Solidity project uses CMake to configure the build. -You might want to install ccache to speed up repeated builds. +You might want to install `ccache`_ to speed up repeated builds. CMake will pick it up automatically. Building Solidity is quite similar on Linux, macOS and other Unices: +.. _ccache: https://ccache.dev/ + .. code-block:: bash mkdir build @@ -347,11 +500,14 @@ And for Windows: mkdir build cd build - cmake -G "Visual Studio 15 2017 Win64" .. + cmake -G "Visual Studio 16 2019" .. + +In case you want to use the version of boost installed by ``scripts\install_deps.ps1``, you will +additionally need to pass ``-DBoost_DIR="deps\boost\lib\cmake\Boost-*"`` and ``-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded`` +as arguments to the call to ``cmake``. -This latter set of instructions should result in the creation of -**solidity.sln** in that build directory. Double-clicking on that file -should result in Visual Studio firing up. We suggest building +This should result in the creation of **solidity.sln** in that build directory. +Double-clicking on that file should result in Visual Studio firing up. We suggest building **Release** configuration, but all others work. Alternatively, you can build for Windows on the command-line, like so: @@ -360,7 +516,7 @@ Alternatively, you can build for Windows on the command-line, like so: cmake --build . --config Release -CMake options +CMake Options ============= If you are interested what CMake options are available run ``cmake .. -LH``. @@ -388,7 +544,7 @@ Inside the build folder you can disable them, since they are enabled by default: # disables both Z3 and CVC4 cmake .. -DUSE_CVC4=OFF -DUSE_Z3=OFF -The version string in detail +The Version String in Detail ============================ The Solidity version string contains four parts: @@ -400,27 +556,27 @@ The Solidity version string contains four parts: If there are local modifications, the commit will be postfixed with ``.mod``. -These parts are combined as required by Semver, where the Solidity pre-release tag equals to the Semver pre-release -and the Solidity commit and platform combined make up the Semver build metadata. +These parts are combined as required by SemVer, where the Solidity pre-release tag equals to the SemVer pre-release +and the Solidity commit and platform combined make up the SemVer build metadata. A release example: ``0.4.8+commit.60cc1668.Emscripten.clang``. A pre-release example: ``0.4.9-nightly.2017.1.17+commit.6ecb4aa3.Emscripten.clang`` -Important information about versioning +Important Information About Versioning ====================================== After a release is made, the patch version level is bumped, because we assume that only patch level changes follow. When changes are merged, the version should be bumped according -to semver and the severity of the change. Finally, a release is always made with the version +to SemVer and the severity of the change. Finally, a release is always made with the version of the current nightly build, but without the ``prerelease`` specifier. Example: -0. the 0.4.0 release is made -1. nightly build has a version of 0.4.1 from now on -2. non-breaking changes are introduced - no change in version -3. a breaking change is introduced - version is bumped to 0.5.0 -4. the 0.5.0 release is made +1. The 0.4.0 release is made. +2. The nightly build has a version of 0.4.1 from now on. +3. Non-breaking changes are introduced --> no change in version. +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 `. diff --git a/compiler/docs/internals/layout_in_calldata.rst b/compiler/docs/internals/layout_in_calldata.rst new file mode 100644 index 00000000..aef27b15 --- /dev/null +++ b/compiler/docs/internals/layout_in_calldata.rst @@ -0,0 +1,16 @@ + +.. index: calldata layout + +******************* +Layout of Call Data +******************* + +The input data for a function call is assumed to be in the format defined by the :ref:`ABI +specification `. Among others, the ABI specification requires arguments to be padded to multiples of 32 +bytes. The internal function calls use a different convention. + +Arguments for the constructor of a contract are directly appended at the end of the +contract's code, also in ABI encoding. The constructor will access them through a hard-coded offset, and +not by using the ``codesize`` opcode, since this of course changes when appending +data to the code. + diff --git a/compiler/docs/internals/layout_in_memory.rst b/compiler/docs/internals/layout_in_memory.rst new file mode 100644 index 00000000..8c20b625 --- /dev/null +++ b/compiler/docs/internals/layout_in_memory.rst @@ -0,0 +1,72 @@ + +.. index: memory layout + +**************** +Layout in Memory +**************** + +Solidity reserves four 32-byte slots, with specific byte ranges (inclusive of endpoints) being used as follows: + +- ``0x00`` - ``0x3f`` (64 bytes): scratch space for hashing methods +- ``0x40`` - ``0x5f`` (32 bytes): currently allocated memory size (aka. free memory pointer) +- ``0x60`` - ``0x7f`` (32 bytes): zero slot + +Scratch space can be used between statements (i.e. within inline assembly). The zero slot +is used as initial value for dynamic memory arrays and should never be written to +(the free memory pointer points to ``0x80`` initially). + +Solidity always places new objects at the free memory pointer and +memory is never freed (this might change in the future). + +Elements in memory arrays in Solidity always occupy multiples of 32 bytes (this +is even true for ``bytes1[]``, but not for ``bytes`` and ``string``). +Multi-dimensional memory arrays are pointers to memory arrays. The length of a +dynamic array is stored at the first slot of the array and followed by the array +elements. + +.. warning:: + There are some operations in Solidity that need a temporary memory area + larger than 64 bytes and therefore will not fit into the scratch space. + They will be placed where the free memory points to, but given their + short lifetime, the pointer is not updated. The memory may or may not + be zeroed out. Because of this, one should not expect the free memory + to point to zeroed out memory. + + While it may seem like a good idea to use ``msize`` to arrive at a + definitely zeroed out memory area, using such a pointer non-temporarily + without updating the free memory pointer can have unexpected results. + + +Differences to Layout in Storage +================================ + +As described above the layout in memory is different from the layout in +:ref:`storage`. Below there are some examples. + +Example for Difference in Arrays +-------------------------------- + +The following array occupies 32 bytes (1 slot) in storage, but 128 +bytes (4 items with 32 bytes each) in memory. + +.. code-block:: solidity + + uint8[4] a; + + + +Example for Difference in Struct Layout +--------------------------------------- + +The following struct occupies 96 bytes (3 slots of 32 bytes) in storage, +but 128 bytes (4 items with 32 bytes each) in memory. + + +.. code-block:: solidity + + struct S { + uint a; + uint b; + uint8 c; + uint8 d; + } diff --git a/compiler/docs/internals/layout_in_storage.rst b/compiler/docs/internals/layout_in_storage.rst new file mode 100644 index 00000000..53670eeb --- /dev/null +++ b/compiler/docs/internals/layout_in_storage.rst @@ -0,0 +1,407 @@ +.. index:: storage, state variable, mapping + +************************************ +Layout of State Variables in Storage +************************************ + +.. _storage-inplace-encoding: + +State variables of contracts are stored in storage in a compact way such +that multiple values sometimes use the same storage slot. +Except for dynamically-sized arrays and mappings (see below), data is stored +contiguously item after item starting with the first state variable, +which is stored in slot ``0``. For each variable, +a size in bytes is determined according to its type. +Multiple, contiguous items that need less than 32 bytes are packed into a single +storage slot if possible, according to the following rules: + +- The first item in a storage slot is stored lower-order aligned. +- Value types use only as many bytes as are necessary to store them. +- If a value type does not fit the remaining part of a storage slot, it is stored in the next storage slot. +- Structs and array data always start a new slot and their items are packed tightly according to these rules. +- Items following struct or array data always start a new storage slot. + +For contracts that use inheritance, the ordering of state variables is determined by the +C3-linearized order of contracts starting with the most base-ward contract. If allowed +by the above rules, state variables from different contracts do share the same storage slot. + +The elements of structs and arrays are stored after each other, just as if they were given +as individual values. + +.. warning:: + When using elements that are smaller than 32 bytes, your contract's gas usage may be higher. + This is because the EVM operates on 32 bytes at a time. Therefore, if the element is smaller + than that, the EVM must use more operations in order to reduce the size of the element from 32 + bytes to the desired size. + + It might be beneficial to use reduced-size types if you are dealing with storage values + because the compiler will pack multiple elements into one storage slot, and thus, combine + multiple reads or writes into a single operation. + If you are not reading or writing all the values in a slot at the same time, this can + have the opposite effect, though: When one value is written to a multi-value storage + slot, the storage slot has to be read first and then + combined with the new value such that other data in the same slot is not destroyed. + + When dealing with function arguments or memory + values, there is no inherent benefit because the compiler does not pack these values. + + Finally, in order to allow the EVM to optimize for this, ensure that you try to order your + storage variables and ``struct`` members such that they can be packed tightly. For example, + declaring your storage variables in the order of ``uint128, uint128, uint256`` instead of + ``uint128, uint256, uint128``, as the former will only take up two slots of storage whereas the + latter will take up three. + +.. note:: + The layout of state variables in storage is considered to be part of the external interface + of Solidity due to the fact that storage pointers can be passed to libraries. This means that + any change to the rules outlined in this section is considered a breaking change + of the language and due to its critical nature should be considered very carefully before + being executed. In the event of such a breaking change, we would want to release a + compatibility mode in which the compiler would generate bytecode supporting the old layout. + + +Mappings and Dynamic Arrays +=========================== + +.. _storage-hashed-encoding: + +Due to their unpredictable size, mappings and dynamically-sized array types cannot be stored +"in between" the state variables preceding and following them. +Instead, they are considered to occupy only 32 bytes with regards to the +:ref:`rules above ` and the elements they contain are stored starting at a different +storage slot that is computed using a Keccak-256 hash. + +Assume the storage location of the mapping or array ends up being a slot ``p`` +after applying :ref:`the storage layout rules `. +For dynamic arrays, +this slot stores the number of elements in the array (byte arrays and +strings are an exception, see :ref:`below `). +For mappings, the slot stays empty, but it is still needed to ensure that even if there are +two mappings next to each other, their content ends up at different storage locations. + +Array data is located starting at ``keccak256(p)`` and it is laid out in the same way as +statically-sized array data would: One element after the other, potentially sharing +storage slots if the elements are not longer than 16 bytes. Dynamic arrays of dynamic arrays apply this +rule recursively. The location of element ``x[i][j]``, where the type of ``x`` is ``uint24[][]``, is +computed as follows (again, assuming ``x`` itself is stored at slot ``p``): +The slot is ``keccak256(keccak256(p) + i) + floor(j / floor(256 / 24))`` and +the element can be obtained from the slot data ``v`` using ``(v >> ((j % floor(256 / 24)) * 24)) & type(uint24).max``. + +The value corresponding to a mapping key ``k`` is located at ``keccak256(h(k) . p)`` +where ``.`` is concatenation and ``h`` is a function that is applied to the key depending on its type: + +- for value types, ``h`` pads the value to 32 bytes in the same way as when storing the value in memory. +- for strings and byte arrays, ``h(k)`` is just the unpadded data. + +If the mapping value is a +non-value type, the computed slot marks the start of the data. If the value is of struct type, +for example, you have to add an offset corresponding to the struct member to reach the member. + +As an example, consider the following contract: + +.. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.0 <0.9.0; + + + contract C { + struct S { uint16 a; uint16 b; uint256 c; } + uint x; + mapping(uint => mapping(uint => S)) data; + } + +Let us compute the storage location of ``data[4][9].c``. +The position of the mapping itself is ``1`` (the variable ``x`` with 32 bytes precedes it). +This means ``data[4]`` is stored at ``keccak256(uint256(4) . uint256(1))``. The type of ``data[4]`` is +again a mapping and the data for ``data[4][9]`` starts at slot +``keccak256(uint256(9) . keccak256(uint256(4) . uint256(1)))``. +The slot offset of the member ``c`` inside the struct ``S`` is ``1`` because ``a`` and ``b`` are packed +in a single slot. This means the slot for +``data[4][9].c`` is ``keccak256(uint256(9) . keccak256(uint256(4) . uint256(1))) + 1``. +The type of the value is ``uint256``, so it uses a single slot. + + +.. _bytes-and-string: + +``bytes`` and ``string`` +------------------------ + +``bytes`` and ``string`` are encoded identically. +In general, the encoding is similar to ``bytes1[]``, in the sense that there is a slot for the array itself and +a data area that is computed using a ``keccak256`` hash of that slot's position. +However, for short values (shorter than 32 bytes) the array elements are stored together with the length in the same slot. + +In particular: if the data is at most ``31`` bytes long, the elements are stored +in the higher-order bytes (left aligned) and the lowest-order byte stores the value ``length * 2``. +For byte arrays that store data which is ``32`` or more bytes long, the main slot ``p`` stores ``length * 2 + 1`` and the data is +stored as usual in ``keccak256(p)``. This means that you can distinguish a short array from a long array +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 IR, reading an invalidly encoded slot results in a ``Panic(0x22)`` error. + +JSON Output +=========== + +.. _storage-layout-top-level: + +The storage layout of a contract can be requested via +the :ref:`standard JSON interface `. The output is a JSON object containing two keys, +``storage`` and ``types``. The ``storage`` object is an array where each +element has the following form: + + +.. code-block:: json + + + { + "astId": 2, + "contract": "fileA:A", + "label": "x", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + +The example above is the storage layout of ``contract A { uint x; }`` from source unit ``fileA`` +and + +- ``astId`` is the id of the AST node of the state variable's declaration +- ``contract`` is the name of the contract including its path as prefix +- ``label`` is the name of the state variable +- ``offset`` is the offset in bytes within the storage slot according to the encoding +- ``slot`` is the storage slot where the state variable resides or starts. This + number may be very large and therefore its JSON value is represented as a + string. +- ``type`` is an identifier used as key to the variable's type information (described in the following) + +The given ``type``, in this case ``t_uint256`` represents an element in +``types``, which has the form: + + +.. code-block:: json + + { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32", + } + +where + +- ``encoding`` how the data is encoded in storage, where the possible values are: + + - ``inplace``: data is laid out contiguously in storage (see :ref:`above `). + - ``mapping``: Keccak-256 hash-based method (see :ref:`above `). + - ``dynamic_array``: Keccak-256 hash-based method (see :ref:`above `). + - ``bytes``: single slot or Keccak-256 hash-based depending on the data size (see :ref:`above `). + +- ``label`` is the canonical type name. +- ``numberOfBytes`` is the number of used bytes (as a decimal string). + Note that if ``numberOfBytes > 32`` this means that more than one slot is used. + +Some types have extra information besides the four above. Mappings contain +its ``key`` and ``value`` types (again referencing an entry in this mapping +of types), arrays have its ``base`` type, and structs list their ``members`` in +the same format as the top-level ``storage`` (see :ref:`above +`). + +.. 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. + +The following example shows a contract and its storage layout, containing +value and reference types, types that are encoded packed, and nested types. + + +.. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.0 <0.9.0; + contract A { + struct S { + uint128 a; + uint128 b; + uint[2] staticArray; + uint[] dynArray; + } + + uint x; + uint y; + S s; + address addr; + mapping (uint => mapping (address => bool)) map; + uint[] array; + string s1; + bytes b1; + } + +.. code-block:: json + + { + "storage": [ + { + "astId": 15, + "contract": "fileA:A", + "label": "x", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 17, + "contract": "fileA:A", + "label": "y", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 20, + "contract": "fileA:A", + "label": "s", + "offset": 0, + "slot": "2", + "type": "t_struct(S)13_storage" + }, + { + "astId": 22, + "contract": "fileA:A", + "label": "addr", + "offset": 0, + "slot": "6", + "type": "t_address" + }, + { + "astId": 28, + "contract": "fileA:A", + "label": "map", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_uint256,t_mapping(t_address,t_bool))" + }, + { + "astId": 31, + "contract": "fileA:A", + "label": "array", + "offset": 0, + "slot": "8", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 33, + "contract": "fileA:A", + "label": "s1", + "offset": 0, + "slot": "9", + "type": "t_string_storage" + }, + { + "astId": 35, + "contract": "fileA:A", + "label": "b1", + "offset": 0, + "slot": "10", + "type": "t_bytes_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)2_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[2]", + "numberOfBytes": "64" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_uint256,t_mapping(t_address,t_bool))": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => mapping(address => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_bool)" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(S)13_storage": { + "encoding": "inplace", + "label": "struct A.S", + "members": [ + { + "astId": 3, + "contract": "fileA:A", + "label": "a", + "offset": 0, + "slot": "0", + "type": "t_uint128" + }, + { + "astId": 5, + "contract": "fileA:A", + "label": "b", + "offset": 16, + "slot": "0", + "type": "t_uint128" + }, + { + "astId": 9, + "contract": "fileA:A", + "label": "staticArray", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)2_storage" + }, + { + "astId": 12, + "contract": "fileA:A", + "label": "dynArray", + "offset": 0, + "slot": "3", + "type": "t_array(t_uint256)dyn_storage" + } + ], + "numberOfBytes": "128" + }, + "t_uint128": { + "encoding": "inplace", + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } diff --git a/compiler/docs/internals/optimizer.rst b/compiler/docs/internals/optimizer.rst new file mode 100644 index 00000000..3c12f0ad --- /dev/null +++ b/compiler/docs/internals/optimizer.rst @@ -0,0 +1,1340 @@ +.. index:: optimizer, optimiser, common subexpression elimination, constant propagation +.. _optimizer: + +************* +The Optimizer +************* + +The Solidity compiler uses two different optimizer modules: The "old" optimizer +that operates at the opcode level and the "new" optimizer that operates on Yul IR code. + +The opcode-based optimizer applies a set of `simplification rules `_ +to opcodes. It also combines equal code sets and removes unused code. + +The Yul-based optimizer is much more powerful, because it can work across function +calls. For example, arbitrary jumps are not possible in Yul, so it is +possible to compute the side-effects of each function. Consider two function calls, +where the first does not modify storage and the second does modify storage. +If their arguments and return values do not depend on each other, we can reorder +the function calls. Similarly, if a function is +side-effect free and its result is multiplied by zero, you can remove the function +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 Yul IR for a Solidity source. Similarly, one can use ``solc --strict-assembly --optimize`` +for a stand-alone Yul mode. + +.. note:: + The `peephole optimizer `_ and the inliner are always + enabled by default and can only be turned off via the :ref:`Standard JSON `. + +You can find more details on both optimizer modules and their optimization steps below. + +Benefits of Optimizing Solidity Code +==================================== + +Overall, the optimizer tries to simplify complicated expressions, which reduces both code +size and execution cost, i.e., it can reduce gas needed for contract deployment as well as for external calls made to the contract. +It also specializes or inlines functions. Especially +function inlining is an operation that can cause much bigger code, but it is +often done because it results in opportunities for more simplifications. + + +Differences between Optimized and Non-Optimized Code +==================================================== + +Generally, the most visible difference is that constant expressions are evaluated at compile time. +When it comes to the ASM output, one can also notice a reduction of equivalent or duplicate +code blocks (compare the output of the flags ``--asm`` and ``--asm --optimize``). However, +when it comes to the Yul/intermediate-representation, there can be significant +differences, for example, functions may be inlined, combined, or rewritten to eliminate +redundancies, etc. (compare the output between the flags ``--ir`` and +``--optimize --ir-optimized``). + +.. _optimizer-parameter-runs: + +Optimizer Parameter Runs +======================== + +The number of runs (``--optimize-runs``) specifies roughly how often each opcode of the +deployed code will be executed across the life-time of the contract. This means it is a +trade-off parameter between code size (deploy cost) and code execution cost (cost after deployment). +A "runs" parameter of "1" will produce short but expensive code. In contrast, a larger "runs" +parameter will produce longer but more gas efficient code. The maximum value of the parameter +is ``2**32-1``. + +.. note:: + + A common misconception is that this parameter specifies the number of iterations of the optimizer. + This is not true: The optimizer will always run as many times as it can still improve the code. + +Opcode-Based Optimizer Module +============================= + +The opcode-based optimizer module operates on assembly code. It splits the +sequence of instructions into basic blocks at ``JUMPs`` and ``JUMPDESTs``. +Inside these blocks, the optimizer analyzes the instructions and records every modification to the stack, +memory, or storage as an expression which consists of an instruction and +a list of arguments which are pointers to other expressions. + +Additionally, the opcode-based optimizer +uses a component called "CommonSubexpressionEliminator" that, amongst other +tasks, finds expressions that are always equal (on every input) and combines +them into an expression class. It first tries to find each new +expression in a list of already known expressions. If no such matches are found, +it simplifies the expression according to rules like +``constant + constant = sum_of_constants`` or ``X * 1 = X``. Since this is +a recursive process, we can also apply the latter rule if the second factor +is a more complex expression which we know always evaluates to one. + +Certain optimizer steps symbolically track the storage and memory locations. For example, this +information is used to compute Keccak-256 hashes that can be evaluated during compile time. Consider +the sequence: + +.. code-block:: none + + PUSH 32 + PUSH 0 + CALLDATALOAD + PUSH 100 + DUP2 + MSTORE + KECCAK256 + +or the equivalent Yul + +.. code-block:: yul + + let x := calldataload(0) + mstore(x, 100) + let value := keccak256(x, 32) + +In this case, the optimizer tracks the value at a memory location ``calldataload(0)`` and then +realizes that the Keccak-256 hash can be evaluated at compile time. This only works if there is no +other instruction that modifies memory between the ``mstore`` and ``keccak256``. So if there is an +instruction that writes to memory (or storage), then we need to erase the knowledge of the current +memory (or storage). There is, however, an exception to this erasing, when we can easily see that +the instruction doesn't write to a certain location. + +For example, + +.. code-block:: yul + + let x := calldataload(0) + mstore(x, 100) + // Current knowledge memory location x -> 100 + let y := add(x, 32) + // Does not clear the knowledge that x -> 100, since y does not write to [x, x + 32) + mstore(y, 200) + // This Keccak-256 can now be evaluated + let value := keccak256(x, 32) + +Therefore, modifications to storage and memory locations, of say location ``l``, must erase +knowledge about storage or memory locations which may be equal to ``l``. More specifically, for +storage, the optimizer has to erase all knowledge of symbolic locations, that may be equal to ``l`` +and for memory, the optimizer has to erase all knowledge of symbolic locations that may not be at +least 32 bytes away. If ``m`` denotes an arbitrary location, then this decision on erasure is done +by computing the value ``sub(l, m)``. For storage, if this value evaluates to a literal that is +non-zero, then the knowledge about ``m`` will be kept. For memory, if the value evaluates to a +literal that is between ``32`` and ``2**256 - 32``, then the knowledge about ``m`` will be kept. In +all other cases, the knowledge about ``m`` will be erased. + +After this process, we know which expressions have to be on the stack at +the end, and have a list of modifications to memory and storage. This information +is stored together with the basic blocks and is used to link them. Furthermore, +knowledge about the stack, storage and memory configuration is forwarded to +the next block(s). + +If we know the targets of all ``JUMP`` and ``JUMPI`` instructions, +we can build a complete control flow graph of the program. If there is only +one target we do not know (this can happen as in principle, jump targets can +be computed from inputs), we have to erase all knowledge about the input state +of a block as it can be the target of the unknown ``JUMP``. If the opcode-based +optimizer module finds a ``JUMPI`` whose condition evaluates to a constant, it transforms it +to an unconditional jump. + +As the last step, the code in each block is re-generated. The optimizer creates +a dependency graph from the expressions on the stack at the end of the block, +and it drops every operation that is not part of this graph. It generates code +that applies the modifications to memory and storage in the order they were +made in the original code (dropping modifications which were found not to be +needed). Finally, it generates all values that are required to be on the +stack in the correct place. + +These steps are applied to each basic block and the newly generated code +is used as replacement if it is smaller. If a basic block is split at a +``JUMPI`` and during the analysis, the condition evaluates to a constant, +the ``JUMPI`` is replaced based on the value of the constant. Thus code like + +.. code-block:: solidity + + uint x = 7; + data[7] = 9; + if (data[x] != x + 2) // this condition is never true + return 2; + else + return 1; + +simplifies to this: + +.. code-block:: solidity + + data[7] = 9; + return 1; + +Simple Inlining +--------------- + +Since Solidity version 0.8.2, there is another optimizer step that replaces certain +jumps to blocks containing "simple" instructions ending with a "jump" by a copy of these instructions. +This corresponds to inlining of simple, small Solidity or Yul functions. In particular, the sequence +``PUSHTAG(tag) JUMP`` may be replaced, whenever the ``JUMP`` is marked as jump "into" a +function and behind ``tag`` there is a basic block (as described above for the +"CommonSubexpressionEliminator") that ends in another ``JUMP`` which is marked as a jump +"out of" a function. + +In particular, consider the following prototypical example of assembly generated for a +call to an internal Solidity function: + +.. code-block:: text + + tag_return + tag_f + jump // in + tag_return: + ...opcodes after call to f... + + tag_f: + ...body of function f... + jump // out + +As long as the body of the function is a continuous basic block, the "Inliner" can replace ``tag_f jump`` by +the block at ``tag_f`` resulting in: + +.. code-block:: text + + tag_return + ...body of function f... + jump + tag_return: + ...opcodes after call to f... + + tag_f: + ...body of function f... + jump // out + +Now ideally, the other optimizer steps described above will result in the return tag push being moved +towards the remaining jump resulting in: + +.. code-block:: text + + ...body of function f... + tag_return + jump + tag_return: + ...opcodes after call to f... + + tag_f: + ...body of function f... + jump // out + +In this situation the "PeepholeOptimizer" will remove the return jump. Ideally, all of this can be done +for all references to ``tag_f`` leaving it unused, s.t. it can be removed, yielding: + +.. code-block:: text + + ...body of function f... + ...opcodes after call to f... + +So the call to function ``f`` is inlined and the original definition of ``f`` can be removed. + +Inlining like this is attempted, whenever a heuristics suggests that inlining is cheaper over the lifetime of a +contract than not inlining. This heuristics depends on the size of the function body, the +number of other references to its tag (approximating the number of calls to the function) and +the expected number of executions of the contract (the global optimizer parameter "runs"). + + +Yul-Based Optimizer Module +========================== + +The Yul-based optimizer consists of several stages and components that all transform +the AST in a semantically equivalent way. The goal is to end up either with code +that is shorter or at least only marginally longer but will allow further +optimization steps. + +.. warning:: + + Since the optimizer is under heavy development, the information here might be outdated. + If you rely on a certain functionality, please reach out to the team directly. + +The optimizer currently follows a purely greedy strategy and does not do any +backtracking. + +All components of the Yul-based optimizer module are explained below. +The following transformation steps are the main components: + +- SSA Transform +- Common Subexpression Eliminator +- Expression Simplifier +- Redundant Assign Eliminator +- Full Inliner + +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`. + +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: + +.. code-block:: bash + + solc --optimize --ir-optimized --yul-optimizations 'dhfoD[xarrscLMcCTU]uljmul' + +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. + +Available abbreviations are listed in the :ref:`Yul optimizer docs `. + +Preprocessing +------------- + +The preprocessing components perform transformations to get the program +into a certain normal form that is easier to work with. This normal +form is kept during the rest of the optimization process. + +.. _disambiguator: + +Disambiguator +^^^^^^^^^^^^^ + +The disambiguator takes an AST and returns a fresh copy where all identifiers have +unique names in the input AST. This is a prerequisite for all other optimizer stages. +One of the benefits is that identifier lookup does not need to take scopes into account +which simplifies the analysis needed for other steps. + +All subsequent stages have the property that all names stay unique. This means if +a new identifier needs to be introduced, a new unique name is generated. + +.. _function-hoister: + +FunctionHoister +^^^^^^^^^^^^^^^ + +The function hoister moves all function definitions to the end of the topmost block. This is +a semantically equivalent transformation as long as it is performed after the +disambiguation stage. The reason is that moving a definition to a higher-level block cannot decrease +its visibility and it is impossible to reference variables defined in a different function. + +The benefit of this stage is that function definitions can be looked up more easily +and functions can be optimized in isolation without having to traverse the AST completely. + +.. _function-grouper: + +FunctionGrouper +^^^^^^^^^^^^^^^ + +The function grouper has to be applied after the disambiguator and the function hoister. +Its effect is that all topmost elements that are not function definitions are moved +into a single block which is the first statement of the root block. + +After this step, a program has the following normal form: + +.. code-block:: text + + { I F... } + +Where ``I`` is a (potentially empty) block that does not contain any function definitions (not even recursively) +and ``F`` is a list of function definitions such that no function contains a function definition. + +The benefit of this stage is that we always know where the list of function begins. + +.. _for-loop-condition-into-body: + +ForLoopConditionIntoBody +^^^^^^^^^^^^^^^^^^^^^^^^ + +This transformation moves the loop-iteration condition of a for-loop into loop body. +We need this transformation because :ref:`expression-splitter` will not +apply to iteration condition expressions (the ``C`` in the following example). + +.. code-block:: text + + for { Init... } C { Post... } { + Body... + } + +is transformed to + +.. code-block:: text + + for { Init... } 1 { Post... } { + if iszero(C) { break } + Body... + } + +This transformation can also be useful when paired with ``LoopInvariantCodeMotion``, since +invariants in the loop-invariant conditions can then be taken outside the loop. + +.. _for-loop-init-rewriter: + +ForLoopInitRewriter +^^^^^^^^^^^^^^^^^^^ + +This transformation moves the initialization part of a for-loop to before +the loop: + +.. code-block:: text + + for { Init... } C { Post... } { + Body... + } + +is transformed to + +.. code-block:: text + + Init... + for {} C { Post... } { + Body... + } + +This eases the rest of the optimization process because we can ignore +the complicated scoping rules of the for loop initialisation block. + +.. _var-decl-initializer: + +VarDeclInitializer +^^^^^^^^^^^^^^^^^^ +This step rewrites variable declarations so that all of them are initialized. +Declarations like ``let x, y`` are split into multiple declaration statements. + +Only supports initializing with the zero literal for now. + +Pseudo-SSA Transformation +------------------------- + +The purpose of this components is to get the program into a longer form, +so that other components can more easily work with it. The final representation +will be similar to a static-single-assignment (SSA) form, with the difference +that it does not make use of explicit "phi" functions which combines the values +from different branches of control flow because such a feature does not exist +in the Yul language. Instead, when control flow merges, if a variable is re-assigned +in one of the branches, a new SSA variable is declared to hold its current value, +so that the following expressions still only need to reference SSA variables. + +An example transformation is the following: + +.. code-block:: yul + + { + let a := calldataload(0) + let b := calldataload(0x20) + if gt(a, 0) { + b := mul(b, 0x20) + } + a := add(a, 1) + sstore(a, add(b, 0x20)) + } + + +When all the following transformation steps are applied, the program will look +as follows: + +.. code-block:: yul + + { + let _1 := 0 + let a_9 := calldataload(_1) + let a := a_9 + let _2 := 0x20 + let b_10 := calldataload(_2) + let b := b_10 + let _3 := 0 + let _4 := gt(a_9, _3) + if _4 + { + let _5 := 0x20 + let b_11 := mul(b_10, _5) + b := b_11 + } + let b_12 := b + let _6 := 1 + let a_13 := add(a_9, _6) + let _7 := 0x20 + let _8 := add(b_12, _7) + sstore(a_13, _8) + } + +Note that the only variable that is re-assigned in this snippet is ``b``. +This re-assignment cannot be avoided because ``b`` has different values +depending on the control flow. All other variables never change their +value once they are defined. The advantage of this property is that +variables can be freely moved around and references to them +can be exchanged by their initial value (and vice-versa), +as long as these values are still valid in the new context. + +Of course, the code here is far from being optimized. To the contrary, it is much +longer. The hope is that this code will be easier to work with and furthermore, +there are optimizer steps that undo these changes and make the code more +compact again at the end. + +.. _expression-splitter: + +ExpressionSplitter +^^^^^^^^^^^^^^^^^^ + +The expression splitter turns expressions like ``add(mload(0x123), mul(mload(0x456), 0x20))`` +into a sequence of declarations of unique variables that are assigned sub-expressions +of that expression so that each function call has only variables +as arguments. + +The above would be transformed into + +.. code-block:: yul + + { + let _1 := 0x20 + let _2 := 0x456 + let _3 := mload(_2) + let _4 := mul(_3, _1) + let _5 := 0x123 + let _6 := mload(_5) + let z := add(_6, _4) + } + +Note that this transformation does not change the order of opcodes or function calls. + +It is not applied to loop iteration-condition, because the loop control flow does not allow +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) +function calls cannot appear nested inside expressions +and all function call arguments have to be variables. + +The benefits of this form are that it is much easier to re-order the sequence of opcodes +and it is also easier to perform function call inlining. Furthermore, it is simpler +to replace individual parts of expressions or re-organize the "expression tree". +The drawback is that such code is much harder to read for humans. + +.. _SSA-transform: + +SSATransform +^^^^^^^^^^^^ + +This stage tries to replace repeated assignments to +existing variables by declarations of new variables as much as +possible. +The reassignments are still there, but all references to the +reassigned variables are replaced by the newly declared variables. + +Example: + +.. code-block:: yul + + { + let a := 1 + mstore(a, 2) + a := 3 + } + +is transformed to + +.. code-block:: yul + + { + let a_1 := 1 + let a := a_1 + mstore(a_1, 2) + let a_3 := 3 + a := a_3 + } + +Exact semantics: + +For any variable ``a`` that is assigned to somewhere in the code +(variables that are declared with value and never re-assigned +are not modified) perform the following transforms: + +- replace ``let a := v`` by ``let a_i := v let a := a_i`` +- replace ``a := v`` by ``let a_i := v a := a_i`` where ``i`` is a number such that ``a_i`` is yet unused. + +Furthermore, always record the current value of ``i`` used for ``a`` and replace each +reference to ``a`` by ``a_i``. +The current value mapping is cleared for a variable ``a`` at the end of each block +in which it was assigned to and at the end of the for loop init block if it is assigned +inside the for loop body or post block. +If a variable's value is cleared according to the rule above and the variable is declared outside +the block, a new SSA variable will be created at the location where control flow joins, +this includes the beginning of loop post/body block and the location right after +If/Switch/ForLoop/Block statement. + +After this stage, the Redundant Assign Eliminator is recommended to remove the unnecessary +intermediate assignments. + +This stage provides best results if the Expression Splitter and the Common Subexpression Eliminator +are run right before it, because then it does not generate excessive amounts of variables. +On the other hand, the Common Subexpression Eliminator could be more efficient if run after the +SSA transform. + +.. _redundant-assign-eliminator: + +RedundantAssignEliminator +^^^^^^^^^^^^^^^^^^^^^^^^^ + +The SSA transform always generates an assignment of the form ``a := a_i``, even though +these might be unnecessary in many cases, like the following example: + +.. code-block:: yul + + { + let a := 1 + a := mload(a) + a := sload(a) + sstore(a, 1) + } + +The SSA transform converts this snippet to the following: + +.. code-block:: yul + + { + let a_1 := 1 + let a := a_1 + let a_2 := mload(a_1) + a := a_2 + let a_3 := sload(a_2) + a := a_3 + sstore(a_3, 1) + } + +The Redundant Assign Eliminator removes all the three assignments to ``a``, because +the value of ``a`` is not used and thus turn this +snippet into strict SSA form: + +.. code-block:: yul + + { + let a_1 := 1 + let a_2 := mload(a_1) + let a_3 := sload(a_2) + sstore(a_3, 1) + } + +Of course the intricate parts of determining whether an assignment is redundant or not +are connected to joining control flow. + +The component works as follows in detail: + +The AST is traversed twice: in an information gathering step and in the +actual removal step. During information gathering, we maintain a +mapping from assignment statements to the three states +"unused", "undecided" and "used" which signifies whether the assigned +value will be used later by a reference to the variable. + +When an assignment is visited, it is added to the mapping in the "undecided" state +(see remark about for loops below) and every other assignment to the same variable +that is still in the "undecided" state is changed to "unused". +When a variable is referenced, the state of any assignment to that variable still +in the "undecided" state is changed to "used". + +At points where control flow splits, a copy +of the mapping is handed over to each branch. At points where control flow +joins, the two mappings coming from the two branches are combined in the following way: +Statements that are only in one mapping or have the same state are used unchanged. +Conflicting values are resolved in the following way: + +- "unused", "undecided" -> "undecided" +- "unused", "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. +In other words, we create three control flow paths: Zero runs of the loop, +one run and two runs and then combine them at the end. + +Simulating a third run or even more is unnecessary, which can be seen as follows: + +A state of an assignment at the beginning of the iteration will deterministically +result in a state of that assignment at the end of the iteration. Let this +state mapping function be called ``f``. The combination of the three different +states ``unused``, ``undecided`` and ``used`` as explained above is the ``max`` +operation where ``unused = 0``, ``undecided = 1`` and ``used = 2``. + +The proper way would be to compute + +.. code-block:: none + + max(s, f(s), f(f(s)), f(f(f(s))), ...) + +as state after the loop. Since ``f`` just has a range of three different values, +iterating it has to reach a cycle after at most three iterations, +and thus ``f(f(f(s)))`` has to equal one of ``s``, ``f(s)``, or ``f(f(s))`` +and thus + +.. code-block:: none + + max(s, f(s), f(f(s))) = max(s, f(s), f(f(s)), f(f(f(s))), ...). + +In summary, running the loop at most twice is enough because there are only three +different states. + +For switch statements that have a "default"-case, there is no control-flow +part that skips the switch. + +When a variable goes out of scope, all statements still in the "undecided" +state are changed to "unused", unless the variable is the return +parameter of a function - there, the state changes to "used". + +In the second traversal, all assignments that are in the "unused" state are removed. + +This step is usually run right after the SSA transform to complete +the generation of the pseudo-SSA. + +Tools +----- + +Movability +^^^^^^^^^^ + +Movability is a property of an expression. It roughly means that the expression +is side-effect free and its evaluation only depends on the values of variables +and the call-constant state of the environment. Most expressions are movable. +The following parts make an expression non-movable: + +- function calls (might be relaxed in the future if all statements in the function are movable) +- opcodes that (can) have side-effects (like ``call`` or ``selfdestruct``) +- opcodes that read or write memory, storage or external state information +- opcodes that depend on the current PC, memory size or returndata size + +DataflowAnalyzer +^^^^^^^^^^^^^^^^ + +The Dataflow Analyzer is not an optimizer step itself but is used as a tool +by other components. While traversing the AST, it tracks the current value of +each variable, as long as that value is a movable expression. +It records the variables that are part of the expression +that is currently assigned to each other variable. Upon each assignment to +a variable ``a``, the current stored value of ``a`` is updated and +all stored values of all variables ``b`` are cleared whenever ``a`` is part +of the currently stored expression for ``b``. + +At control-flow joins, knowledge about variables is cleared if they have or would be assigned +in any of the control-flow paths. For instance, upon entering a +for loop, all variables are cleared that will be assigned during the +body or the post block. + +Expression-Scale Simplifications +-------------------------------- + +These simplification passes change expressions and replace them by equivalent +and hopefully simpler expressions. + +.. _common-subexpression-eliminator: + +CommonSubexpressionEliminator +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This step uses the Dataflow Analyzer and replaces subexpressions that +syntactically match the current value of a variable by a reference to +that variable. This is an equivalence transform because such subexpressions have +to be movable. + +All subexpressions that are identifiers themselves are replaced by their +current value if the value is an identifier. + +The combination of the two rules above allow to compute a local value +numbering, which means that if two variables have the same +value, one of them will always be unused. The Unused Pruner or the +Redundant Assign Eliminator will then be able to fully eliminate such +variables. + +This step is especially efficient if the expression splitter is run +before. If the code is in pseudo-SSA form, +the values of variables are available for a longer time and thus we +have a higher chance of expressions to be replaceable. + +The expression simplifier will be able to perform better replacements +if the common subexpression eliminator was run right before it. + +.. _expression-simplifier: + +Expression Simplifier +^^^^^^^^^^^^^^^^^^^^^ + +The Expression Simplifier uses the Dataflow Analyzer and makes use +of a list of equivalence transforms on expressions like ``X + 0 -> X`` +to simplify the code. + +It tries to match patterns like ``X + 0`` on each subexpression. +During the matching procedure, it resolves variables to their currently +assigned expressions to be able to match more deeply nested patterns +even when the code is in pseudo-SSA form. + +Some of the patterns like ``X - X -> 0`` can only be applied as long +as the expression ``X`` is movable, because otherwise it would remove its potential side-effects. +Since variable references are always movable, even if their current +value might not be, the Expression Simplifier is again more powerful +in split or pseudo-SSA form. + +.. _literal-rematerialiser: + +LiteralRematerialiser +^^^^^^^^^^^^^^^^^^^^^ + +To be documented. + +.. _load-resolver: + +LoadResolver +^^^^^^^^^^^^ + +Optimisation stage that replaces expressions of type ``sload(x)`` and ``mload(x)`` by the value +currently stored in storage resp. memory, if known. + +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 +------------------------------- + +.. _circular-reference-pruner: + +CircularReferencesPruner +^^^^^^^^^^^^^^^^^^^^^^^^ + +This stage removes functions that call each other but are +neither externally referenced nor referenced from the outermost context. + +.. _conditional-simplifier: + +ConditionalSimplifier +^^^^^^^^^^^^^^^^^^^^^ + +The Conditional Simplifier inserts assignments to condition variables if the value can be determined +from the control-flow. + +Destroys SSA form. + +Currently, this tool is very limited, mostly because we do not yet have support +for boolean types. Since conditions only check for expressions being nonzero, +we cannot assign a specific value. + +Current features: + +- switch cases: insert " := " +- after if statement with terminating control-flow, insert " := 0" + +Future features: + +- allow replacements by "1" +- take termination of user-defined functions into account + +Works best with SSA form and if dead code removal has run before. + +Prerequisite: Disambiguator. + +.. _conditional-unsimplifier: + +ConditionalUnsimplifier +^^^^^^^^^^^^^^^^^^^^^^^ + +Reverse of Conditional Simplifier. + +.. _control-flow-simplifier: + +ControlFlowSimplifier +^^^^^^^^^^^^^^^^^^^^^ + +Simplifies several control-flow structures: + +- replace if with empty body with pop(condition) +- remove empty default switch case +- remove empty switch case if no default case exists +- replace switch with no cases with pop(expression) +- turn switch with single case into if +- replace switch with only default case with pop(expression) and body +- replace switch with const expr with matching case body +- replace ``for`` with terminating control flow and without other break/continue by ``if`` +- remove ``leave`` at the end of a function. + +None of these operations depend on the data flow. The StructuralSimplifier +performs similar tasks that do depend on data flow. + +The ControlFlowSimplifier does record the presence or absence of ``break`` +and ``continue`` statements during its traversal. + +Prerequisite: Disambiguator, FunctionHoister, ForLoopInitRewriter. +Important: Introduces EVM opcodes and thus can only be used on EVM code for now. + +.. _dead-code-eliminator: + +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. + +Function definitions are retained as they might be called by earlier +code and thus are considered reachable. + +Because variables declared in a for loop's init block have their scope extended to the loop body, +we require ForLoopInitRewriter to run before this step. + +Prerequisite: ForLoopInitRewriter, Function Hoister, Function Grouper + +.. _equal-store-eliminator: + +EqualStoreEliminator +^^^^^^^^^^^^^^^^^^^^ + +This steps removes ``mstore(k, v)`` and ``sstore(k, v)`` calls if +there was a previous call to ``mstore(k, v)`` / ``sstore(k, v)``, +no other store in between and the values of ``k`` and ``v`` did not change. + +This simple step is effective if run after the SSA transform and the +Common Subexpression Eliminator, because SSA will make sure that the variables +will not change and the Common Subexpression Eliminator re-uses exactly the same +variable if the value is known to be the same. + +Prerequisites: Disambiguator, ForLoopInitRewriter + +.. _unused-pruner: + +UnusedPruner +^^^^^^^^^^^^ + +This step removes the definitions of all functions that are never referenced. + +It also removes the declaration of variables that are never referenced. +If the declaration assigns a value that is not movable, the expression is retained, +but its value is discarded. + +All movable expression statements (expressions that are not assigned) are removed. + +.. _structural-simplifier: + +StructuralSimplifier +^^^^^^^^^^^^^^^^^^^^ + +This is a general step that performs various kinds of simplifications on +a structural level: + +- replace if statement with empty body by ``pop(condition)`` +- replace if statement with true condition by its body +- remove if statement with false condition +- turn switch with single case into if +- replace switch with only default case by ``pop(expression)`` and body +- replace switch with literal expression by matching case body +- replace for loop with false condition by its initialization part + +This component uses the Dataflow Analyzer. + +.. _block-flattener: + +BlockFlattener +^^^^^^^^^^^^^^ + +This stage eliminates nested blocks by inserting the statement in the +inner block at the appropriate place in the outer block. It depends on the +FunctionGrouper and does not flatten the outermost block to keep the form +produced by the FunctionGrouper. + +.. code-block:: yul + + { + { + let x := 2 + { + let y := 3 + mstore(x, y) + } + } + } + +is transformed to + +.. code-block:: yul + + { + { + let x := 2 + let y := 3 + mstore(x, y) + } + } + +As long as the code is disambiguated, this does not cause a problem because +the scopes of variables can only grow. + +.. _loop-invariant-code-motion: + +LoopInvariantCodeMotion +^^^^^^^^^^^^^^^^^^^^^^^ +This optimization moves movable SSA variable declarations outside the loop. + +Only statements at the top level in a loop's body or post block are considered, i.e variable +declarations inside conditional branches will not be moved out of the loop. + +Requirements: + +- The Disambiguator, ForLoopInitRewriter and FunctionHoister must be run upfront. +- Expression splitter and SSA transform should be run upfront to obtain better result. + + +Function-Level Optimizations +---------------------------- + +.. _function-specializer: + +FunctionSpecializer +^^^^^^^^^^^^^^^^^^^ + +This step specializes the function with its literal arguments. + +If a function, say, ``function f(a, b) { sstore (a, b) }``, is called with literal arguments, for +example, ``f(x, 5)``, where ``x`` is an identifier, it could be specialized by creating a new +function ``f_1`` that takes only one argument, i.e., + +.. code-block:: yul + + function f_1(a_1) { + let b_1 := 5 + sstore(a_1, b_1) + } + +Other optimization steps will be able to make more simplifications to the function. The +optimization step is mainly useful for functions that would not be inlined. + +Prerequisites: Disambiguator, FunctionHoister + +LiteralRematerialiser is recommended as a prerequisite, even though it's not required for +correctness. + +.. _unused-function-parameter-pruner: + +UnusedFunctionParameterPruner +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This step removes unused parameters in a function. + +If a parameter is unused, like ``c`` and ``y`` in, ``function f(a,b,c) -> x, y { x := div(a,b) }``, we +remove the parameter and create a new "linking" function as follows: + +.. code-block:: yul + + function f(a,b) -> x { x := div(a,b) } + function f2(a,b,c) -> x, y { x := f(a,b) } + +and replace all references to ``f`` by ``f2``. +The inliner should be run afterwards to make sure that all references to ``f2`` are replaced by +``f``. + +Prerequisites: Disambiguator, FunctionHoister, LiteralRematerialiser. + +The step LiteralRematerialiser is not required for correctness. It helps deal with cases such as: +``function f(x) -> y { revert(y, y} }`` where the literal ``y`` will be replaced by its value ``0``, +allowing us to rewrite the function. + +.. _equivalent-function-combiner: + +EquivalentFunctionCombiner +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If two functions are syntactically equivalent, while allowing variable +renaming but not any re-ordering, then any reference to one of the +functions is replaced by the other. + +The actual removal of the function is performed by the Unused Pruner. + + +Function Inlining +----------------- + +.. _expression-inliner: + +ExpressionInliner +^^^^^^^^^^^^^^^^^ + +This component of the optimizer performs restricted function inlining by inlining functions that can be +inlined inside functional expressions, i.e. functions that: + +- return a single value. +- have a body like ``r := ``. +- neither reference themselves nor ``r`` in the right hand side. + +Furthermore, for all parameters, all of the following need to be true: + +- The argument is movable. +- The parameter is either referenced less than twice in the function body, or the argument is rather cheap + ("cost" of at most 1, like a constant up to 0xff). + +Example: The function to be inlined has the form of ``function f(...) -> r { r := E }`` where +``E`` is an expression that does not reference ``r`` and all arguments in the function call are movable expressions. + +The result of this inlining is always a single expression. + +This component can only be used on sources with unique names. + +.. _full-inliner: + +FullInliner +^^^^^^^^^^^ + +The Full Inliner 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 +code than more efficient code. In same cases, though, inlining a function +can have positive effects on subsequent optimizer steps. This is the case +if one of the function arguments is a constant, for example. + +During inlining, a heuristic is used to tell if the function call +should be inlined or not. +The current heuristic does not inline into "large" functions unless +the called function is tiny. Functions that are only used once +are inlined, as well as medium-sized functions, while function +calls with constant arguments allow slightly larger functions. + + +In the future, we may include a backtracking component +that, instead of inlining a function right away, only specializes it, +which means that a copy of the function is generated where +a certain parameter is always replaced by a constant. After that, +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. + +Cleanup +------- + +The cleanup is performed at the end of the optimizer run. It tries +to combine split expressions into deeply nested ones again and also +improves the "compilability" for stack machines by eliminating +variables as much as possible. + +.. _expression-joiner: + +ExpressionJoiner +^^^^^^^^^^^^^^^^ + +This is the opposite operation of the expression splitter. It turns a sequence of +variable declarations that have exactly one reference into a complex expression. +This stage fully preserves the order of function calls and opcode executions. +It does not make use of any information concerning the commutativity of the opcodes; +if moving the value of a variable to its place of use would change the order +of any function call or opcode execution, the transformation is not performed. + +Note that the component will not move the assigned value of a variable assignment +or a variable that is referenced more than once. + +The snippet ``let x := add(0, 2) let y := mul(x, mload(2))`` is not transformed, +because it would cause the order of the call to the opcodes ``add`` and +``mload`` to be swapped - even though this would not make a difference +because ``add`` is movable. + +When reordering opcodes like that, variable references and literals are ignored. +Because of that, the snippet ``let x := add(0, 2) let y := mul(x, 3)`` is +transformed to ``let y := mul(add(0, 2), 3)``, even though the ``add`` opcode +would be executed after the evaluation of the literal ``3``. + +.. _SSA-reverser: + +SSAReverser +^^^^^^^^^^^ + +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 +be better to just re-use existing variables with assignments instead of +fresh variable declarations. + +The SSA transform rewrites + +.. code-block:: yul + + let a := calldataload(0) + mstore(a, 1) + +to + +.. code-block:: yul + + let a_1 := calldataload(0) + let a := a_1 + mstore(a_1, 1) + let a_2 := calldataload(0x20) + a := a_2 + +The problem is that instead of ``a``, the variable ``a_1`` is used +whenever ``a`` was referenced. The SSA transform changes statements +of this form by just swapping out the declaration and the assignment. The above +snippet is turned into + +.. code-block:: yul + + let a := calldataload(0) + let a_1 := a + mstore(a_1, 1) + a := calldataload(0x20) + let a_2 := a + +This is a very simple equivalence transform, but when we now run the +Common Subexpression Eliminator, it will replace all occurrences of ``a_1`` +by ``a`` (until ``a`` is re-assigned). The Unused Pruner will then +eliminate the variable ``a_1`` altogether and thus fully reverse the +SSA transform. + +.. _stack-compressor: + +StackCompressor +^^^^^^^^^^^^^^^ + +One problem that makes code generation for the Ethereum Virtual Machine +hard is the fact that there is a hard limit of 16 slots for reaching +down the expression stack. This more or less translates to a limit +of 16 local variables. The stack compressor takes Yul code and +compiles it to EVM bytecode. Whenever the stack difference is too +large, it records the function this happened in. + +For each function that caused such a problem, the Rematerialiser +is called with a special request to aggressively eliminate specific +variables sorted by the cost of their values. + +On failure, this procedure is repeated multiple times. + +.. _rematerialiser: + +Rematerialiser +^^^^^^^^^^^^^^ + +The rematerialisation stage tries to replace variable references by the expression that +was last assigned to the variable. This is of course only beneficial if this expression +is comparatively cheap to evaluate. Furthermore, it is only semantically equivalent if +the value of the expression did not change between the point of assignment and the +point of use. The main benefit of this stage is that it can save stack slots if it +leads to a variable being eliminated completely (see below), but it can also +save a DUP opcode on the EVM if the expression is very cheap. + +The Rematerialiser uses the Dataflow Analyzer to track the current values of variables, +which are always movable. +If the value is very cheap or the variable was explicitly requested to be eliminated, +the variable reference is replaced by its current value. + +.. _for-loop-condition-out-of-body: + +ForLoopConditionOutOfBody +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Reverses the transformation of ForLoopConditionIntoBody. + +For any movable ``c``, it turns + +.. code-block:: none + + for { ... } 1 { ... } { + if iszero(c) { break } + ... + } + +into + +.. code-block:: none + + for { ... } c { ... } { + ... + } + +and it turns + +.. code-block:: none + + for { ... } 1 { ... } { + if c { break } + ... + } + +into + +.. code-block:: none + + for { ... } iszero(c) { ... } { + ... + } + +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. diff --git a/compiler/docs/internals/source_mappings.rst b/compiler/docs/internals/source_mappings.rst new file mode 100644 index 00000000..11027b8a --- /dev/null +++ b/compiler/docs/internals/source_mappings.rst @@ -0,0 +1,70 @@ +.. index:: source mappings + +*************** +Source Mappings +*************** + +As part of the AST output, the compiler provides the range of the source +code that is represented by the respective node in the AST. This can be +used for various purposes ranging from static analysis tools that report +errors based on the AST and debugging tools that highlight local variables +and their uses. + +Furthermore, the compiler can also generate a mapping from the bytecode +to the range in the source code that generated the instruction. This is again +important for static analysis tools that operate on bytecode level and +for displaying the current position in the source code inside a debugger +or for breakpoint handling. This mapping also contains other information, +like the jump type and the modifier depth (see below). + +Both kinds of source mappings use integer identifiers to refer to source files. +The identifier of a source file is stored in +``output['sources'][sourceName]['id']`` where ``output`` is the output of the +standard-json compiler interface parsed as JSON. +For some utility routines, the compiler generates "internal" source files +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 :: + 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. + +The source mappings inside the AST use the following +notation: + +``s:l:f`` + +Where ``s`` is the byte-offset to the start of the range in the source file, +``l`` is the length of the source range in bytes and ``f`` is the source +index mentioned above. + +The encoding in the source mapping for the bytecode is more complicated: +It is a list of ``s:l:f:j:m`` separated by ``;``. Each of these +elements corresponds to an instruction, i.e. you cannot use the byte offset +but have to use the instruction offset (push instructions are longer than a single byte). +The fields ``s``, ``l`` and ``f`` are as above. ``j`` can be either +``i``, ``o`` or ``-`` signifying whether a jump instruction goes into a +function, returns from a function or is a regular jump as part of e.g. a loop. +The last field, ``m``, is an integer that denotes the "modifier depth". This depth +is increased whenever the placeholder statement (``_``) is entered in a modifier +and decreased when it is left again. This allows debuggers to track tricky cases +like the same modifier being used twice or multiple placeholder statements being +used in a single modifier. + +In order to compress these source mappings especially for bytecode, the +following rules are used: + +- If a field is empty, the value of the preceding element is used. +- If a ``:`` is missing, all following fields are considered empty. + +This means the following source mappings represent the same information: + +``1:2:1;1:9:1;2:1:2;2:1:2;2:1:2`` + +``1:2:1;:9;2:1:2;;`` + +Important to note is that when the :ref:`verbatim ` builtin is used, +the source mappings will be invalid: The builtin is considered a single +instruction instead of potentially multiple. diff --git a/compiler/docs/internals/variable_cleanup.rst b/compiler/docs/internals/variable_cleanup.rst new file mode 100644 index 00000000..9fec6929 --- /dev/null +++ b/compiler/docs/internals/variable_cleanup.rst @@ -0,0 +1,52 @@ +.. index: variable cleanup + +********************* +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 +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 +hashes or sent as the data of a message call. Similarly, before +storing a value in the storage, the remaining bits need to be cleaned +because otherwise the garbled value can be observed. + +Note that access via inline assembly is not considered such an operation: +If you use inline assembly to access Solidity variables +shorter than 256 bits, the compiler does not guarantee that +the value is properly cleaned up. + +Moreover, we do not clean the bits if the immediately +following operation is not affected. For instance, since any non-zero +value is considered ``true`` by ``JUMPI`` instruction, we do not clean +the boolean values before they are used as the condition for +``JUMPI``. + +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: + ++---------------+---------------+-------------------+ +|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 | ++---------------+---------------+-------------------+ diff --git a/compiler/docs/introduction-to-smart-contracts.rst b/compiler/docs/introduction-to-smart-contracts.rst index fada5d29..875e5ebc 100644 --- a/compiler/docs/introduction-to-smart-contracts.rst +++ b/compiler/docs/introduction-to-smart-contracts.rst @@ -10,14 +10,15 @@ 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 =============== -:: +.. code-block:: solidity - pragma solidity >=0.4.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.4.16 <0.9.0; contract SimpleStorage { uint storedData; @@ -31,8 +32,12 @@ Storage Example } } -The first line tells you that the source code is written for -Solidity version 0.4.0, or a newer version of the language up to, but not including version 0.7.0. +The first line tells you that the source code is licensed under the +GPL version 3.0. Machine-readable license specifiers are important +in a setting where publishing the source code is the default. + +The next line specifies that the source code is written for +Solidity version 0.4.16, or a newer version of the language up to, but not including version 0.9.0. This is to ensure that the contract is not compilable with a new (breaking) compiler version, where it could behave differently. :ref:`Pragmas` are common instructions for compilers about how to treat the source code (e.g. `pragma once `_). @@ -46,8 +51,10 @@ code that manages the database. In this example, the contract defines the functions ``set`` and ``get`` that can be used to modify or retrieve the value of the variable. -To access a state variable, you do not need the prefix ``this.`` as is common in -other languages. +To access a member (like a state variable) of the current contract, you do not typically add the ``this.`` prefix, +you just access it directly via its name. +Unlike in some other languages, omitting it is not just a matter of style, +it results in a completely different way to access the member, but more on this later. This contract does not do much yet apart from (due to the infrastructure built by Ethereum) allowing anyone to store a single number that is accessible by @@ -75,9 +82,10 @@ cryptocurrency. The contract allows only its creator to create new coins (differ Anyone can send coins to each other without a need for registering with a username and password, all you need is an Ethereum keypair. -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.4; contract Coin { // The keyword "public" makes variables @@ -91,7 +99,7 @@ registering with a username and password, all you need is an Ethereum keypair. // Constructor code is only run when the contract // is created - constructor() public { + constructor() { minter = msg.sender; } @@ -99,14 +107,23 @@ registering with a username and password, all you need is an Ethereum keypair. // Can only be called by the contract creator function mint(address receiver, uint amount) public { require(msg.sender == minter); - require(amount < 1e60); balances[receiver] += amount; } + // Errors allow you to provide information about + // why an operation failed. They are returned + // to the caller of the function. + error InsufficientBalance(uint requested, uint available); + // Sends an amount of existing coins // from any caller to an address function send(address receiver, uint amount) public { - require(amount <= balances[msg.sender], "Insufficient balance."); + if (amount > balances[msg.sender]) + revert InsufficientBalance({ + requested: amount, + available: balances[msg.sender] + }); + balances[msg.sender] -= amount; balances[receiver] += amount; emit Sent(msg.sender, receiver, amount); @@ -123,7 +140,9 @@ of a keypair belonging to :ref:`external accounts`. The keyword ``public`` automatically generates a function that allows you to access the current value of the state variable from outside of the contract. Without this keyword, other contracts have no way to access the variable. The code of the function generated by the compiler is equivalent -to the following (ignore ``external`` and ``view`` for now):: +to the following (ignore ``external`` and ``view`` for now): + +.. code-block:: solidity function minter() external view returns (address) { return minter; } @@ -145,10 +164,12 @@ even better, keep a list, or use a more suitable data type. The :ref:`getter function` created by the ``public`` keyword is more complex in the case of a mapping. It looks like the -following:: +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. @@ -165,7 +186,9 @@ transactions. To listen for this event, you could use the following JavaScript code, which uses `web3.js `_ to create the ``Coin`` contract object, -and any user interface calls the automatically generated ``balances`` function from above:: +and any user interface calls the automatically generated ``balances`` function from above: + +.. code-block:: javascript Coin.Sent().watch({}, '', function(error, result) { if (!error) { @@ -180,7 +203,7 @@ and any user interface calls the automatically generated ``balances`` function f .. index:: coin -The :ref:`constructor` is a special function run during the creation of the contract and +The :ref:`constructor` is a special function that is executed during the creation of the contract and cannot be called afterwards. In this case, it permanently stores the address of the person creating the contract. The ``msg`` variable (together with ``tx`` and ``block``) is a :ref:`special global variable ` that @@ -189,15 +212,28 @@ always the address where the current (external) function call came from. The functions that make up the contract, and that users and contracts can call are ``mint`` and ``send``. -The ``mint`` function sends an amount of newly created coins to another address. -The :ref:`require ` function call defines conditions that reverts all changes if not met. -In this example, ``require(msg.sender == minter);`` ensures that only the creator of the contract can call ``mint``, -and ``require(amount < 1e60);`` ensures a maximum amount of tokens. This ensures that there are no overflow errors in the future. +The ``mint`` function sends an amount of newly created coins to another address. The :ref:`require +` function call defines conditions that reverts all changes if not met. In this +example, ``require(msg.sender == minter);`` ensures that only the creator of the contract can call +``mint``. In general, the creator can mint as many tokens as they like, but at some point, this will +lead to a phenomenon called "overflow". Note that because of the default :ref:`Checked arithmetic +`, the transaction would revert if the expression ``balances[receiver] += amount;`` +overflows, i.e., when ``balances[receiver] + amount`` in arbitrary precision arithmetic is larger +than the maximum value of ``uint`` (``2**256 - 1``). This is also true for the statement +``balances[receiver] += amount;`` in the function ``send``. + +:ref:`Errors ` allow you to provide more information to the caller about +why a condition or operation failed. Errors are used together with the +:ref:`revert statement `. The ``revert`` statement unconditionally +aborts and reverts all changes similar to the ``require`` function, but it also +allows you to provide the name of an error and additional data which will be supplied to the caller +(and eventually to the front-end application or block explorer) so that +a failure can more easily be debugged or reacted upon. The ``send`` function can be used by anyone (who already has some of these coins) to send coins to anyone else. If the sender does not have -enough coins to send, the ``require`` call fails and provides the -sender with an appropriate error message string. +enough coins to send, the ``if`` condition evaluates to true. As a result, the ``revert`` will cause the operation to fail +while providing the sender with error details using the ``InsufficientBalance`` error. .. note:: If you use @@ -279,7 +315,7 @@ likely it will be. since it is not up to the submitter of a transaction, but up to the miners to determine in which block the transaction is included. If you want to schedule future calls of your contract, you can use - the `alarm clock `_ or a similar oracle service. + a smart contract automation tool or an oracle service. .. _the-ethereum-virtual-machine: @@ -323,7 +359,7 @@ Every account has a persistent key-value store mapping 256-bit words to 256-bit words called **storage**. Furthermore, every account has a **balance** in -Ether (in "Wei" to be exact, `1 ether` is `10**18 wei`) which can be modified by sending transactions that +Ether (in "Wei" to be exact, ``1 ether`` is ``10**18 wei``) which can be modified by sending transactions that include Ether. .. index:: ! transaction @@ -362,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. @@ -463,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 @@ -507,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 ============================ @@ -520,9 +563,9 @@ idea, but it is potentially dangerous, as if someone sends Ether to removed contracts, the Ether is forever lost. .. warning:: - Even if a contract is removed by "selfdestruct", it is still part of the + 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. - So using "selfdestruct" is not the same as deleting data from a hard disk. + So using ``selfdestruct`` is not the same as deleting data from a hard disk. .. note:: Even if a contract's code does not contain a call to ``selfdestruct``, @@ -531,3 +574,24 @@ contracts, the Ether is forever lost. If you want to deactivate your contracts, you should instead **disable** them by changing some internal state which causes all functions to revert. This makes it impossible to use the contract, as it returns Ether immediately. + + +.. index:: ! precompiled contracts, ! precompiles, ! contract;precompiled + +.. _precompiledContracts: + +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 +by EVM code stored at that address (they do not contain code) +but instead is implemented in the EVM execution environment itself. + +Different EVM-compatible chains might use a different set of +precompiled contracts. It might also be possible that new +precompiled contracts are added to the Ethereum main chain in the future, +but you can reasonably expect them to always be in the range between +``1`` and ``0xffff`` (inclusive). diff --git a/compiler/docs/ir-breaking-changes.rst b/compiler/docs/ir-breaking-changes.rst new file mode 100644 index 00000000..7e4efce6 --- /dev/null +++ b/compiler/docs/ir-breaking-changes.rst @@ -0,0 +1,311 @@ + +.. index: ir breaking changes + +.. _ir-breaking-changes: + +********************************* +Solidity IR-based Codegen Changes +********************************* + +Solidity can generate EVM bytecode in two different ways: +Either directly from Solidity to EVM opcodes ("old codegen") or through +an intermediate representation ("IR") in Yul ("new codegen" or "IR-based codegen"). + +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. + +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. +This section highlights the main differences between the old and the IR-based codegen. + +Semantic Only Changes +===================== + +This section lists the changes that are semantic-only, thus potentially +hiding new and different behavior in existing code. + +- 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. + Consequently, if the padding space within a struct is used to store data + (e.g. in the context of a contract upgrade), you have to be aware that + ``delete`` will now also clear the added member (while it wouldn't + have been cleared in the past). + + .. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.1; + + contract C { + struct S { + uint64 y; + uint64 z; + } + S s; + function f() public { + // ... + delete s; + // s occupies only first 16 bytes of the 32 bytes slot + // delete will write zero to the full slot + } + } + + We have the same behavior for implicit delete, for example when array of structs is shortened. + +- Function modifiers are implemented in a slightly different way regarding function parameters and return variables. + This especially has an effect if the placeholder ``_;`` is evaluated multiple times in a modifier. + In the old code generator, each function parameter and return variable has a fixed slot on the stack. + If the function is run multiple times because ``_;`` is used multiple times or used in a loop, then a + change to the function parameter's or return variable's value is visible in the next execution of the function. + The new code generator implements modifiers using actual functions and passes function parameters on. + This means that multiple evaluations of a function's body will get the same values for the parameters, + and the effect on return variables is that they are reset to their default (zero) value for each + execution. + + .. code-block:: solidity + + // 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++; + } + 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. + + .. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.1 <0.9.0; + + contract C { + bool active = true; + modifier mod() + { + _; + active = false; + _; + } + function foo() external mod() returns (uint ret) + { + if (active) + ret = 1; // Same as ``return 1`` + } + } + + The function ``C.foo()`` returns the following values: + + - Old code generator: ``1`` as the return variable is initialized to ``0`` only once before the first ``_;`` + evaluation and then overwritten by the ``return 1;``. It is not initialized again for the second ``_;`` + evaluation and ``foo()`` does not explicitly assign it either (due to ``active == false``), thus it keeps + its first value. + - New code generator: ``0`` as all parameters, including return parameters, will be re-initialized before + each ``_;`` evaluation. + + .. index:: ! evaluation order; expression + +- For the old code generator, the evaluation order of expressions is unspecified. + For the new code generator, we try to evaluate in source order (left to right), but do not guarantee it. + This can lead to semantic differences. + + For example: + + .. code-block:: solidity + + // 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; + } + } + + 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 + + .. index:: ! evaluation order; function arguments + + On the other hand, function argument expressions are evaluated in the same order + by both code generators with the exception of the global functions ``addmod`` and ``mulmod``. + For example: + + .. code-block:: solidity + + // 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 g(uint8 a, uint8 b) public pure returns (uint8) { + return add(++a + ++b, a + b); + } + } + + The function ``g(1, 2)`` returns the following values: + + - Old code generator: ``10`` (``add(2 + 3, 2 + 3)``) but the return value is unspecified in general + - New code generator: ``10`` but the return value is not guaranteed + + The arguments to the global functions ``addmod`` and ``mulmod`` are evaluated right-to-left by the old code generator + and left-to-right by the new code generator. + For example: + + .. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.8.1; + contract C { + function f() public pure returns (uint256 aMod, uint256 mMod) { + uint256 x = 3; + // Old code gen: add/mulmod(5, 4, 3) + // New code gen: add/mulmod(4, 5, 5) + aMod = addmod(++x, ++x, x); + mMod = mulmod(++x, ++x, x); + } + } + + The function ``f()`` returns the following values: + + - Old code generator: ``aMod = 0`` and ``mMod = 2`` + - New code generator: ``aMod = 4`` and ``mMod = 0`` + +- The new code generator imposes a hard limit of ``type(uint64).max`` + (``0xffffffffffffffff``) for the free memory pointer. Allocations that would + increase its value beyond this limit revert. The old code generator does not + have this limit. + + For example: + + .. code-block:: solidity + :force: + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >0.8.0; + contract C { + function f() public { + uint[] memory arr; + // allocation size: 576460752303423481 + // assumes freeMemPtr points to 0x80 initially + uint solYulMaxAllocationBeforeMemPtrOverflow = (type(uint64).max - 0x80 - 31) / 32; + // freeMemPtr overflows UINT64_MAX + arr = new uint[](solYulMaxAllocationBeforeMemPtrOverflow); + } + } + + 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) + + +Internals +========= + +Internal function pointers +-------------------------- + +.. index:: function pointers + +The old code generator uses code offsets or tags for values of internal function pointers. This is especially complicated since +these offsets are different at construction time and after deployment and the values can cross this border via storage. +Because of that, both offsets are encoded at construction time into the same value (into different bytes). + +In the new code generator, function pointers use internal IDs that are allocated in sequence. Since calls via jumps are not possible, +calls through function pointers always have to use an internal dispatch function that uses the ``switch`` statement to select +the right function. + +The ID ``0`` is reserved for uninitialized function pointers which then cause a panic in the dispatch function when called. + +In the old code generator, internal function pointers are initialized with a special function that always causes a panic. +This causes a storage write at construction time for internal function pointers in storage. + +Cleanup +------- + +.. index:: cleanup, dirty bits + +The old code generator only performs cleanup before an operation whose result could be affected by the values of the dirty bits. +The new code generator performs cleanup after any operation that can result in dirty bits. +The hope is that the optimizer will be powerful enough to eliminate redundant cleanup operations. + +For example: + +.. code-block:: solidity + :force: + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.8.1; + contract C { + function f(uint8 a) public pure returns (uint r1, uint r2) + { + a = ~a; + assembly { + r1 := a + } + r2 = a; + } + } + +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``. diff --git a/compiler/docs/language-influences.rst b/compiler/docs/language-influences.rst new file mode 100644 index 00000000..e4f0ab69 --- /dev/null +++ b/compiler/docs/language-influences.rst @@ -0,0 +1,25 @@ +################### +Language Influences +################### + +Solidity is a `curly-bracket language `_ +that has been influenced and inspired by several well-known programming languages. + +Solidity is most profoundly influenced by C++, but also borrowed concepts from languages like +Python, JavaScript, and others. + +The influence from C++ can be seen in the syntax for variable declarations, for loops, the concept +of overloading functions, implicit and explicit type conversions and many other details. + +In the early days of the language, Solidity used to be partly influenced by JavaScript. +This was due to function-level scoping of variables and the use of the keyword ``var``. +The JavaScript influence was reduced starting from version 0.4.0. +Now, the main remaining similarity to JavaScript is that functions are defined using the keyword +``function``. Solidity also supports import syntax and semantics that +are similar to those available in JavaScript. Besides those points, Solidity looks like +most other curly-bracket languages and has no major JavaScript influence anymore. + +Another influence to Solidity was Python. Solidity's modifiers were added trying to model +Python's decorators with a much more restricted functionality. Furthermore, multiple inheritance, C3 linearization, +and the ``super`` keyword are taken from Python as well as the general assignment and copy semantics of value +and reference types. diff --git a/compiler/docs/layout-of-source-files.rst b/compiler/docs/layout-of-source-files.rst index 1fec22ae..9a584785 100644 --- a/compiler/docs/layout-of-source-files.rst +++ b/compiler/docs/layout-of-source-files.rst @@ -3,9 +3,45 @@ Layout of a Solidity Source File ******************************** Source files can contain an arbitrary number of -:ref:`contract definitions`, import_ directives, -:ref:`pragma directives` and -:ref:`struct` and :ref:`enum` definitions. +:ref:`contract definitions`, import_ , +:ref:`pragma` and :ref:`using for` directives and +:ref:`struct`, :ref:`enum`, :ref:`function`, :ref:`error` +and :ref:`constant variable` definitions. + +.. index:: ! license, spdx + +SPDX License Identifier +======================= + +Trust in smart contracts can be better established if their source code +is available. Since making source code available always touches on legal problems +with regards to copyright, the Solidity compiler encourages the use +of machine-readable `SPDX license identifiers `_. +Every source file should start with a comment indicating its license: + +``// SPDX-License-Identifier: MIT`` + +The compiler does not validate that the license is part of the +`list allowed by SPDX `_, but +it does include the supplied string in the :ref:`bytecode metadata `. + +If you do not want to specify a license or if the source code is +not open-source, please use the special value ``UNLICENSED``. +Note that ``UNLICENSED`` (no usage allowed, not present in SPDX license list) +is different from ``UNLICENSE`` (grants all rights to everyone). +Solidity follows `the npm recommendation `_. + +Supplying this comment of course does not free you from other +obligations related to licensing like having to mention +a specific license header in each source file or the +original copyright holder. + +The comment is recognized by the compiler anywhere in the file at the +file level, but it is recommended to put it at the top of the file. + +More information about how to use SPDX license identifiers +can be found at the `SPDX website `_. + .. index:: ! pragma @@ -16,11 +52,11 @@ Pragmas The ``pragma`` keyword is used to enable certain compiler features or checks. A pragma directive is always local to a source file, so -you have to add the pragma to all your files if you want enable it +you have to add the pragma to all your files if you want to enable it in your whole project. If you :ref:`import` another file, the pragma from that file does *not* automatically apply to the importing file. -.. index:: ! pragma, version +.. index:: ! pragma;version .. _version_pragma: @@ -46,7 +82,7 @@ be sure that your code compiles the way you intended. The exact version of the compiler is not fixed, so that bugfix releases are still possible. It is possible to specify more complex rules for the compiler version, -these follow the same syntax used by `npm `_. +these follow the same syntax used by `npm `_. .. note:: Using the version pragma *does not* change the version of the compiler. @@ -55,8 +91,44 @@ these follow the same syntax used by `npm `_ required by the pragma. If it does not match, the compiler issues an error. -.. index:: ! pragma, experimental +.. index:: ! ABI coder, ! pragma; abicoder, pragma; ABIEncoderV2 +.. _abi_coder: + +ABI Coder Pragma +---------------- +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. 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 +that do not without limitations. The reverse is possible only as long as the +non-``abicoder v2`` contract does not try to make calls that would require +decoding types only supported by the new encoder. The compiler can detect this +and will issue an error. Simply enabling ``abicoder v2`` for your contract is +enough to make the error go away. + +.. note:: + This pragma applies to all the code defined in the file where it is activated, + regardless of where that code ends up eventually. This means that a contract + whose source file is selected to compile with ABI coder v1 + can still contain code that uses the new encoder + by inheriting it from another contract. This is allowed if the new types are only + used internally and not in external function signatures. + +.. note:: + Up to Solidity 0.7.4, it was possible to select the ABI coder v2 + by using ``pragma experimental ABIEncoderV2``, but it was not possible + to explicitly select coder v1 because it was the default. + +.. index:: ! pragma; experimental .. _experimental_pragma: Experimental Pragma @@ -66,18 +138,16 @@ 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 ~~~~~~~~~~~~ -The new ABI encoder 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 experimental ABIEncoderV2;`` - we kept -the same pragma, even though it is not considered experimental -anymore. +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 @@ -99,7 +169,7 @@ The component does not yet support all features of the Solidity language and likely outputs many warnings. In case it reports unsupported features, the analysis may not be fully sound. -.. index:: source file, ! import, module +.. index:: source file, ! import, module, source unit .. _import: @@ -116,10 +186,11 @@ a `default export `_ provides an automatic remapping for -GitHub and automatically retrieves the file over the network. You can import -the iterable mapping as above, e.g. +Import Paths +------------ -:: +In order to be able to support reproducible builds on all platforms, the Solidity compiler has to +abstract away the details of the filesystem where source files are stored. +For this reason import paths do not refer directly to files in the host filesystem. +Instead the compiler maintains an internal database (*virtual filesystem* or *VFS* for short) where +each source unit is assigned a unique *source unit name* which is an opaque and unstructured identifier. +The import path specified in an import statement is translated into a source unit name and used to +find the corresponding source unit in this database. - import "github.com/ethereum/dapp-bin/library/iterable_mapping.sol" as it_mapping; +Using the :ref:`Standard JSON ` API it is possible to directly provide the names and +content of all the source files as a part of the compiler input. +In this case source unit names are truly arbitrary. +If, however, you want the compiler to automatically find and load source code into the VFS, your +source unit names need to be structured in a way that makes it possible for an :ref:`import callback +` to locate them. +When using the command-line compiler the default import callback supports only loading source code +from the host filesystem, which means that your source unit names must be paths. +Some environments provide custom callbacks that are more versatile. +For example the `Remix IDE `_ provides one that +lets you `import files from HTTP, IPFS and Swarm URLs or refer directly to packages in NPM registry +`_. -Remix may add other source code providers in the future. +For a complete description of the virtual filesystem and the path resolution logic used by the +compiler see :ref:`Path Resolution `. .. index:: ! comment, natspec @@ -255,46 +259,22 @@ Comments Single-line comments (``//``) and multi-line comments (``/*...*/``) are possible. -:: +.. code-block:: solidity - // This is a single-line comment. + // This is a single-line comment. - /* - This is a - multi-line comment. - */ + /* + This is a + multi-line comment. + */ .. note:: A single-line comment is terminated by any unicode line terminator - (LF, VF, FF, CR, NEL, LS or PS) in utf8 encoding. The terminator is still part of - the source code after the comment, so if it is not an ascii symbol + (LF, VF, FF, CR, NEL, LS or PS) in UTF-8 encoding. The terminator is still part of + the source code after the comment, so if it is not an ASCII symbol (these are NEL, LS and PS), it will lead to a parser error. -Additionally, there is another type of comment called a natspec comment, -which is detailed in the :ref:`style guide`. They are written with a -triple slash (``///``) or a double asterisk block(``/** ... */``) and +Additionally, there is another type of comment called a NatSpec comment, +which is detailed in the :ref:`style guide`. They are written with a +triple slash (``///``) or a double asterisk block (``/** ... */``) and they should be used directly above function declarations or statements. -You can use `Doxygen `_-style tags inside these comments to document -functions, annotate conditions for formal verification, and provide a -**confirmation text** which is shown to users when they attempt to invoke a -function. - -In the following example we document the title of the contract, the explanation -for the two function parameters and two return variables. - -:: - - pragma solidity >=0.4.0 <0.7.0; - - /** @title Shape calculator. */ - contract ShapeCalculator { - /// @dev Calculates a rectangle's surface and perimeter. - /// @param w Width of the rectangle. - /// @param h Height of the rectangle. - /// @return s The calculated surface. - /// @return p The calculated perimeter. - function rectangle(uint w, uint h) public pure returns (uint s, uint p) { - s = w * h; - p = 2 * (w + h); - } - } diff --git a/compiler/docs/lll.rst b/compiler/docs/lll.rst deleted file mode 100644 index 16be829e..00000000 --- a/compiler/docs/lll.rst +++ /dev/null @@ -1,21 +0,0 @@ -### -LLL -### - -.. _lll: - -LLL is a low-level language for the EVM with an s-expressions syntax. - -The Solidity repository contains an LLL compiler, which shares the assembler subsystem with Solidity. -However, apart from maintaining that it still compiles, no other improvements are made to it. - -It is not built unless specifically requested: - -.. code-block:: bash - - $ cmake -DLLL=ON .. - $ cmake --build . - -.. warning:: - - The LLL codebase is deprecated and will be removed from the Solidity repository in the future. diff --git a/compiler/docs/metadata.rst b/compiler/docs/metadata.rst index 0c8ae47f..317ad220 100644 --- a/compiler/docs/metadata.rst +++ b/compiler/docs/metadata.rst @@ -1,3 +1,5 @@ +.. _metadata: + ################# Contract Metadata ################# @@ -19,9 +21,12 @@ the :ref:`Standard JSON Interface`. You have to publish the metadata file to IPFS, Swarm, or another service so that others can access it. You create the file by using the ``solc --metadata`` -command that generates a file called ``ContractName_meta.json``. It contains -IPFS and Swarm references to the source code, so you have to upload all source -files and the metadata file. +command together with the ``--output-dir`` parameter. Without the parameter, +the metadata will be written to standard output. +The metadata contains IPFS and Swarm references to the source code, so you have to +upload all source files in addition to the metadata file. For IPFS, the hash contained +in the CID returned by ``ipfs add`` (not the direct sha2-256 hash of the file) +shall match with the one contained in the bytecode. The metadata file has the following format. The example below is presented in a human-readable way. Properly formatted metadata should use quotes correctly, @@ -29,32 +34,34 @@ reduce whitespace to a minimum and sort the keys of all objects to arrive at a unique formatting. Comments are not permitted and used here only for explanatory purposes. -.. code-block:: none +.. code-block:: javascript { // Required: The version of the metadata format - version: "1", + "version": "1", // Required: Source code language, basically selects a "sub-version" // of the specification - language: "Solidity", + "language": "Solidity", // Required: Details about the compiler, contents are specific // to the language. - compiler: { + "compiler": { // Required for Solidity: Version of the compiler - version: "0.4.6+commit.2dabbdf0.Emscripten.clang", + "version": "0.8.2+commit.661d1103", // Optional: Hash of the compiler binary which produced this output - keccak256: "0x123..." + "keccak256": "0x123..." }, - // Required: Compilation source files/source units, keys are file names - sources: + // Required: Compilation source files/source units, keys are file paths + "sources": { - "myFile.sol": { + "myDirectory/myFile.sol": { // Required: keccak256 hash of the source file "keccak256": "0x123...", // Required (unless "content" is used, see below): Sorted URL(s) - // to the source file, protocol is more or less arbitrary, but a - // Swarm URL is recommended - "urls": [ "bzzr://56ab..." ] + // to the source file, protocol is more or less arbitrary, but an + // IPFS URL is recommended + "urls": [ "bzz-raw://7d7a...", "dweb:/ipfs/QmN..." ], + // Optional: SPDX license identifier as given in the source file + "license": "MIT" }, "destructible": { // Required: keccak256 hash of the source file @@ -64,53 +71,113 @@ explanatory purposes. } }, // Required: Compiler settings - settings: + "settings": { - // Required for Solidity: Sorted list of remappings - remappings: [ ":g=/dir" ], + // Required for Solidity: Sorted list of import remappings + "remappings": [ ":g=/dir" ], // Optional: Optimizer settings. The fields "enabled" and "runs" are deprecated // and are only given for backwards-compatibility. - optimizer: { - enabled: true, - runs: 500, - details: { + "optimizer": { + "enabled": true, + "runs": 500, + "details": { // peephole defaults to "true" - peephole: true, + "peephole": true, + // inliner defaults to "true" + "inliner": true, // jumpdestRemover defaults to "true" - jumpdestRemover: true, - orderLiterals: false, - deduplicate: false, - cse: false, - constantOptimizer: false, - yul: false, - yulDetails: {} + "jumpdestRemover": true, + "orderLiterals": false, + "deduplicate": false, + "cse": false, + "constantOptimizer": false, + "yul": true, + // Optional: Only present if "yul" is "true" + "yulDetails": { + "stackAllocation": false, + "optimizerSteps": "dhfoDgvulfnTUtnIf..." + } } }, - metadata: { - // Reflects the setting used in the input json, defaults to false - useLiteralContent: true, + "metadata": { + // Reflects the setting used in the input json, defaults to "false" + "useLiteralContent": true, // Reflects the setting used in the input json, defaults to "ipfs" - bytecodeHash: "ipfs" - } - // Required for Solidity: File and name of the contract or library this + "bytecodeHash": "ipfs" + }, + // Required for Solidity: File path and the name of the contract or library this // metadata is created for. - compilationTarget: { - "myFile.sol": "MyContract" + "compilationTarget": { + "myDirectory/myFile.sol": "MyContract" }, // Required for Solidity: Addresses for libraries used - libraries: { + "libraries": { "MyLib": "0x123123..." } }, // Required: Generated information about the contract. - output: + "output": { - // Required: ABI definition of the contract - abi: [ ... ], + // Required: ABI definition of the contract. See "Contract ABI Specification" + "abi": [/* ... */], + // Required: NatSpec developer documentation of the contract. + "devdoc": { + "version": 1 // NatSpec version + "kind": "dev", + // Contents of the @author NatSpec field of the contract + "author": "John Doe", + // Contents of the @title NatSpec field of the contract + "title": "MyERC20: an example ERC20" + // Contents of the @dev NatSpec field of the contract + "details": "Interface of the ERC20 standard as defined in the EIP. See https://eips.ethereum.org/EIPS/eip-20 for details", + "methods": { + "transfer(address,uint256)": { + // Contents of the @dev NatSpec field of the method + "details": "Returns a boolean value indicating whether the operation succeeded. Must be called by the token holder address", + // Contents of the @param NatSpec fields of the method + "params": { + "_value": "The amount tokens to be transferred", + "_to": "The receiver address" + } + // Contents of the @return NatSpec field. + "returns": { + // Return var name (here "success") if exists. "_0" as key if return var is unnamed + "success": "a boolean value indicating whether the operation succeeded" + } + } + }, + "stateVariables": { + "owner": { + // Contents of the @dev NatSpec field of the state variable + "details": "Must be set during contract creation. Can then only be changed by the owner" + } + } + "events": { + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) toanother (`to`)." + "params": { + "from": "The sender address" + "to": "The receiver address" + "value": "The token amount" + } + } + } + }, // Required: NatSpec user documentation of the contract - userdoc: [ ... ], - // Required: NatSpec developer documentation of the contract - devdoc: [ ... ], + "userdoc": { + "version": 1 // NatSpec version + "kind": "user", + "methods": { + "transfer(address,uint256)": { + "notice": "Transfers `_value` tokens to address `_to`" + } + }, + "events": { + "Transfer(address,address,uint256)": { + "notice": "`_value` tokens have been moved from `from` to `to`" + } + } + } } } @@ -137,7 +204,9 @@ the mapping ``{"ipfs": , "solc": }`` is stored contain more keys (see below) and the beginning of that encoding is not easy to find, its length is added in a two-byte big-endian encoding. The current version of the Solidity compiler usually adds the following -to the end of the deployed bytecode:: +to the end of the deployed bytecode + +.. code-block:: text 0xa2 0x64 'i' 'p' 'f' 's' 0x58 0x22 <34 bytes IPFS hash> @@ -145,7 +214,7 @@ to the end of the deployed bytecode:: 0x00 0x33 So in order to retrieve the data, the end of the deployed bytecode can be checked -to match that pattern and use the IPFS hash to retrieve the file. +to match that pattern and the IPFS hash can be used to retrieve the file (if pinned/published). Whereas release builds of solc use a 3 byte encoding of the version as shown above (one byte each for major, minor and patch version number), prerelease builds @@ -169,14 +238,15 @@ Usage for Automatic Interface Generation and NatSpec ==================================================== The metadata is used in the following way: A component that wants to interact -with a contract (e.g. Mist or any wallet) retrieves the code of the contract, -from that the IPFS/Swarm hash of a file which is then retrieved. That file +with a contract (e.g. a wallet) retrieves the code of the contract. +It decodes the CBOR encoded section containing the IPFS/Swarm hash of the +metadata file. With that hash, the metadata file is retrieved. That file is JSON-decoded into a structure like above. The component can then use the ABI to automatically generate a rudimentary user interface for the contract. -Furthermore, the wallet can use the NatSpec user documentation to display a confirmation message to the user +Furthermore, the wallet can use the NatSpec user documentation to display a human-readable confirmation message to the user whenever they interact with the contract, together with requesting authorization for the transaction signature. @@ -194,6 +264,6 @@ This automatically verifies the metadata since its hash is part of the bytecode. Excess data corresponds to the constructor input data, which should be decoded according to the interface and presented to the user. -In the repository `source-verify `_ +In the repository `sourcify `_ (`npm package `_) you can see example code that shows how to use this feature. diff --git a/compiler/docs/miscellaneous.rst b/compiler/docs/miscellaneous.rst deleted file mode 100644 index 085bf99e..00000000 --- a/compiler/docs/miscellaneous.rst +++ /dev/null @@ -1,813 +0,0 @@ -############# -Miscellaneous -############# - -.. index:: storage, state variable, mapping - -************************************ -Layout of State Variables in Storage -************************************ - -.. _storage-inplace-encoding: - -Statically-sized variables (everything except mapping and dynamically-sized -array types) are laid out contiguously in storage starting from position ``0``. -Multiple, contiguous items that need less than 32 bytes are packed into a single -storage slot if possible, according to the following rules: - -- The first item in a storage slot is stored lower-order aligned. -- Elementary types use only as many bytes as are necessary to store them. -- If an elementary type does not fit the remaining part of a storage slot, it is moved to the next storage slot. -- Structs and array data always start a new slot and occupy whole slots - (but items inside a struct or array are packed tightly according to these rules). - -For contracts that use inheritance, the ordering of state variables is determined by the -C3-linearized order of contracts starting with the most base-ward contract. If allowed -by the above rules, state variables from different contracts do share the same storage slot. - -The elements of structs and arrays are stored after each other, just as if they were given explicitly. - -.. warning:: - When using elements that are smaller than 32 bytes, your contract's gas usage may be higher. - This is because the EVM operates on 32 bytes at a time. Therefore, if the element is smaller - than that, the EVM must use more operations in order to reduce the size of the element from 32 - bytes to the desired size. - - It is only beneficial to use reduced-size arguments if you are dealing with storage values - because the compiler will pack multiple elements into one storage slot, and thus, combine - multiple reads or writes into a single operation. When dealing with function arguments or memory - values, there is no inherent benefit because the compiler does not pack these values. - - Finally, in order to allow the EVM to optimize for this, ensure that you try to order your - storage variables and ``struct`` members such that they can be packed tightly. For example, - declaring your storage variables in the order of ``uint128, uint128, uint256`` instead of - ``uint128, uint256, uint128``, as the former will only take up two slots of storage whereas the - latter will take up three. - -.. note:: - The layout of state variables in storage is considered to be part of the external interface - of Solidity due to the fact that storage pointers can be passed to libraries. This means that - any change to the rules outlined in this section is considered a breaking change - of the language and due to its critical nature should be considered very carefully before - being executed. - - -Mappings and Dynamic Arrays -=========================== - -.. _storage-hashed-encoding: - -Due to their unpredictable size, mapping and dynamically-sized array types use a Keccak-256 hash -computation to find the starting position of the value or the array data. -These starting positions are always full stack slots. - -The mapping or the dynamic array itself occupies a slot in storage at some position ``p`` -according to the above rule (or by recursively applying this rule for -mappings of mappings or arrays of arrays). For dynamic arrays, -this slot stores the number of elements in the array (byte arrays and -strings are an exception, see :ref:`below `). -For mappings, the slot is unused (but it is needed so that two equal mappings after each other will use a different -hash distribution). Array data is located at ``keccak256(p)`` and the value corresponding to a mapping key -``k`` is located at ``keccak256(k . p)`` where ``.`` is concatenation. If the value is again a -non-elementary type, the positions are found by adding an offset of ``keccak256(k . p)``. - -So for the following contract snippet -the position of ``data[4][9].b`` is at ``keccak256(uint256(9) . keccak256(uint256(4) . uint256(1))) + 1``:: - - - pragma solidity >=0.4.0 <0.7.0; - - - contract C { - struct S { uint a; uint b; } - uint x; - mapping(uint => mapping(uint => S)) data; - } - -.. _bytes-and-string: - -``bytes`` and ``string`` ------------------------- - -``bytes`` and ``string`` are encoded identically. For short byte arrays, they store their data in the same -slot where the length is also stored. In particular: if the data is at most ``31`` bytes long, it is stored -in the higher-order bytes (left aligned) and the lowest-order byte stores ``length * 2``. -For byte arrays that store data which is ``32`` or more bytes long, the main slot stores ``length * 2 + 1`` and the data is -stored as usual in ``keccak256(slot)``. This means that you can distinguish a short array from a long array -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. - -JSON Output -=========== - -.. _storage-layout-top-level: - -The storage layout of a contract can be requested via -the :ref:`standard JSON interface `. The output is a JSON object containing two keys, -``storage`` and ``types``. The ``storage`` object is an array where each -element has the following form: - - -.. code:: - - - { - "astId": 2, - "contract": "fileA:A", - "label": "x", - "offset": 0, - "slot": "0", - "type": "t_uint256" - } - -The example above is the storage layout of ``contract A { uint x; }`` from source unit ``fileA`` -and - -- ``astId`` is the id of the AST node of the state variable's declaration -- ``contract`` is the name of the contract including its path as prefix -- ``label`` is the name of the state variable -- ``offset`` is the offset in bytes within the storage slot according to the encoding -- ``slot`` is the storage slot where the state variable resides or starts. This - number may be very large and therefore its JSON value is represented as a - string. -- ``type`` is an identifier used as key to the variable's type information (described in the following) - -The given ``type``, in this case ``t_uint256`` represents an element in -``types``, which has the form: - - -.. code:: - - { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32", - } - -where - -- ``encoding`` how the data is encoded in storage, where the possible values are: - - - ``inplace``: data is laid out contiguously in storage (see :ref:`above `). - - ``mapping``: Keccak-256 hash-based method (see :ref:`above `). - - ``dynamic_array``: Keccak-256 hash-based method (see :ref:`above `). - - ``bytes``: single slot or Keccak-256 hash-based depending on the data size (see :ref:`above `). - -- ``label`` is the canonical type name. -- ``numberOfBytes`` is the number of used bytes (as a decimal string). - Note that if ``numberOfBytes > 32`` this means that more than one slot is used. - -Some types have extra information besides the four above. Mappings contain -its ``key`` and ``value`` types (again referencing an entry in this mapping -of types), arrays have its ``base`` type, and structs list their ``members`` in -the same format as the top-level ``storage`` (see :ref:`above -`). - -.. 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. - -The following example shows a contract and its storage layout, containing -value and reference types, types that are encoded packed, and nested types. - - -.. code:: - - pragma solidity >=0.4.0 <0.7.0; - contract A { - struct S { - uint128 a; - uint128 b; - uint[2] staticArray; - uint[] dynArray; - } - - uint x; - uint y; - S s; - address addr; - mapping (uint => mapping (address => bool)) map; - uint[] array; - string s1; - bytes b1; - } - -.. code:: - - "storageLayout": { - "storage": [ - { - "astId": 14, - "contract": "fileA:A", - "label": "x", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 16, - "contract": "fileA:A", - "label": "y", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 18, - "contract": "fileA:A", - "label": "s", - "offset": 0, - "slot": "2", - "type": "t_struct(S)12_storage" - }, - { - "astId": 20, - "contract": "fileA:A", - "label": "addr", - "offset": 0, - "slot": "6", - "type": "t_address" - }, - { - "astId": 26, - "contract": "fileA:A", - "label": "map", - "offset": 0, - "slot": "7", - "type": "t_mapping(t_uint256,t_mapping(t_address,t_bool))" - }, - { - "astId": 29, - "contract": "fileA:A", - "label": "array", - "offset": 0, - "slot": "8", - "type": "t_array(t_uint256)dyn_storage" - }, - { - "astId": 31, - "contract": "fileA:A", - "label": "s1", - "offset": 0, - "slot": "9", - "type": "t_string_storage" - }, - { - "astId": 33, - "contract": "fileA:A", - "label": "b1", - "offset": 0, - "slot": "10", - "type": "t_bytes_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)2_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[2]", - "numberOfBytes": "64" - }, - "t_array(t_uint256)dyn_storage": { - "base": "t_uint256", - "encoding": "dynamic_array", - "label": "uint256[]", - "numberOfBytes": "32" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes_storage": { - "encoding": "bytes", - "label": "bytes", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_bool)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_bool))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(address => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_bool)" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(S)12_storage": { - "encoding": "inplace", - "label": "struct A.S", - "members": [ - { - "astId": 2, - "contract": "fileA:A", - "label": "a", - "offset": 0, - "slot": "0", - "type": "t_uint128" - }, - { - "astId": 4, - "contract": "fileA:A", - "label": "b", - "offset": 16, - "slot": "0", - "type": "t_uint128" - }, - { - "astId": 8, - "contract": "fileA:A", - "label": "staticArray", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)2_storage" - }, - { - "astId": 11, - "contract": "fileA:A", - "label": "dynArray", - "offset": 0, - "slot": "3", - "type": "t_array(t_uint256)dyn_storage" - } - ], - "numberOfBytes": "128" - }, - "t_uint128": { - "encoding": "inplace", - "label": "uint128", - "numberOfBytes": "16" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } - -.. index: memory layout - -**************** -Layout in Memory -**************** - -Solidity reserves four 32-byte slots, with specific byte ranges (inclusive of endpoints) being used as follows: - -- ``0x00`` - ``0x3f`` (64 bytes): scratch space for hashing methods -- ``0x40`` - ``0x5f`` (32 bytes): currently allocated memory size (aka. free memory pointer) -- ``0x60`` - ``0x7f`` (32 bytes): zero slot - -Scratch space can be used between statements (i.e. within inline assembly). The zero slot -is used as initial value for dynamic memory arrays and should never be written to -(the free memory pointer points to ``0x80`` initially). - -Solidity always places new objects at the free memory pointer and -memory is never freed (this might change in the future). - -Elements in memory arrays in Solidity always occupy multiples of 32 bytes (this -is even true for ``byte[]``, but not for ``bytes`` and ``string``). -Multi-dimensional memory arrays are pointers to memory arrays. The length of a -dynamic array is stored at the first slot of the array and followed by the array -elements. - -.. warning:: - There are some operations in Solidity that need a temporary memory area - larger than 64 bytes and therefore will not fit into the scratch space. - They will be placed where the free memory points to, but given their - short lifetime, the pointer is not updated. The memory may or may not - be zeroed out. Because of this, one should not expect the free memory - to point to zeroed out memory. - - While it may seem like a good idea to use ``msize`` to arrive at a - definitely zeroed out memory area, using such a pointer non-temporarily - without updating the free memory pointer can have unexpected results. - -.. index: calldata layout - -******************* -Layout of Call Data -******************* - -The input data for a function call is assumed to be in the format defined by the :ref:`ABI -specification `. Among others, the ABI specification requires arguments to be padded to multiples of 32 -bytes. The internal function calls use a different convention. - -Arguments for the constructor of a contract are directly appended at the end of the -contract's code, also in ABI encoding. The constructor will access them through a hard-coded offset, and -not by using the ``codesize`` opcode, since this of course changes when appending -data to the code. - - -.. index: variable cleanup - -********************************* -Internals - 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 -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 -hashes or sent as the data of a message call. Similarly, before -storing a value in the storage, the remaining bits need to be cleaned -because otherwise the garbled value can be observed. - -On the other hand, we do not clean the bits if the immediately -following operation is not affected. For instance, since any non-zero -value is considered ``true`` by ``JUMPI`` instruction, we do not clean -the boolean values before they are used as the condition for -``JUMPI``. - -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: - -+---------------+---------------+-------------------+ -|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 | -+---------------+---------------+-------------------+ - -.. index:: optimizer, common subexpression elimination, constant propagation - -************************* -Internals - The Optimiser -************************* - -This section discusses the optimiser that was first added to Solidity, -which operates on opcode streams. For information on the new Yul-based optimiser, -please see the `readme on github `_. - -The Solidity optimiser operates on assembly. It splits the sequence of instructions into basic blocks -at ``JUMPs`` and ``JUMPDESTs``. Inside these blocks, the optimiser -analyses the instructions and records every modification to the stack, -memory, or storage as an expression which consists of an instruction and -a list of arguments which are pointers to other expressions. The optimiser -uses a component called "CommonSubexpressionEliminator" that amongst other -tasks, finds expressions that are always equal (on every input) and combines -them into an expression class. The optimiser first tries to find each new -expression in a list of already known expressions. If this does not work, -it simplifies the expression according to rules like -``constant + constant = sum_of_constants`` or ``X * 1 = X``. Since this is -a recursive process, we can also apply the latter rule if the second factor -is a more complex expression where we know that it always evaluates to one. -Modifications to storage and memory locations have to erase knowledge about -storage and memory locations which are not known to be different. If we first -write to location x and then to location y and both are input variables, the -second could overwrite the first, so we do not know what is stored at x after -we wrote to y. If simplification of the expression x - y evaluates to a -non-zero constant, we know that we can keep our knowledge about what is stored at x. - -After this process, we know which expressions have to be on the stack at -the end, and have a list of modifications to memory and storage. This information -is stored together with the basic blocks and is used to link them. Furthermore, -knowledge about the stack, storage and memory configuration is forwarded to -the next block(s). If we know the targets of all ``JUMP`` and ``JUMPI`` instructions, -we can build a complete control flow graph of the program. If there is only -one target we do not know (this can happen as in principle, jump targets can -be computed from inputs), we have to erase all knowledge about the input state -of a block as it can be the target of the unknown ``JUMP``. If the optimiser -finds a ``JUMPI`` whose condition evaluates to a constant, it transforms it -to an unconditional jump. - -As the last step, the code in each block is re-generated. The optimiser creates -a dependency graph from the expressions on the stack at the end of the block, -and it drops every operation that is not part of this graph. It generates code -that applies the modifications to memory and storage in the order they were -made in the original code (dropping modifications which were found not to be -needed). Finally, it generates all values that are required to be on the -stack in the correct place. - -These steps are applied to each basic block and the newly generated code -is used as replacement if it is smaller. If a basic block is split at a -``JUMPI`` and during the analysis, the condition evaluates to a constant, -the ``JUMPI`` is replaced depending on the value of the constant. Thus code like - -:: - - uint x = 7; - data[7] = 9; - if (data[x] != x + 2) - return 2; - else - return 1; - -still simplifies to code which you can compile even though the instructions contained -a jump in the beginning of the process: - -:: - - data[7] = 9; - return 1; - -.. index:: source mappings - -*************** -Source Mappings -*************** - -As part of the AST output, the compiler provides the range of the source -code that is represented by the respective node in the AST. This can be -used for various purposes ranging from static analysis tools that report -errors based on the AST and debugging tools that highlight local variables -and their uses. - -Furthermore, the compiler can also generate a mapping from the bytecode -to the range in the source code that generated the instruction. This is again -important for static analysis tools that operate on bytecode level and -for displaying the current position in the source code inside a debugger -or for breakpoint handling. This mapping also contains other information, -like the jump type and the modifier depth (see below). - -Both kinds of source mappings use integer identifiers to refer to source files. -The identifier of a source file is stored in -``output['sources'][sourceName]['id']`` where ``output`` is the output of the -standard-json compiler interface parsed as JSON. - -.. 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. - -The source mappings inside the AST use the following -notation: - -``s:l:f`` - -Where ``s`` is the byte-offset to the start of the range in the source file, -``l`` is the length of the source range in bytes and ``f`` is the source -index mentioned above. - -The encoding in the source mapping for the bytecode is more complicated: -It is a list of ``s:l:f:j:m`` separated by ``;``. Each of these -elements corresponds to an instruction, i.e. you cannot use the byte offset -but have to use the instruction offset (push instructions are longer than a single byte). -The fields ``s``, ``l`` and ``f`` are as above. ``j`` can be either -``i``, ``o`` or ``-`` signifying whether a jump instruction goes into a -function, returns from a function or is a regular jump as part of e.g. a loop. -The last field, ``m``, is an integer that denotes the "modifier depth". This depth -is increased whenever the placeholder statement (``_``) is entered in a modifier -and decreased when it is left again. This allows debuggers to track tricky cases -like the same modifier being used twice or multiple placeholder statements being -used in a single modifier. - -In order to compress these source mappings especially for bytecode, the -following rules are used: - - - If a field is empty, the value of the preceding element is used. - - If a ``:`` is missing, all following fields are considered empty. - -This means the following source mappings represent the same information: - -``1:2:1;1:9:1;2:1:2;2:1:2;2:1:2`` - -``1:2:1;:9;2:1:2;;`` - -*************** -Tips and Tricks -*************** - -* Use ``delete`` on arrays to delete all its elements. -* Use shorter types for struct elements and sort them such that short types are - grouped together. This can lower the gas costs as multiple ``SSTORE`` operations - might be combined into a single (``SSTORE`` costs 5000 or 20000 gas, so this is - what you want to optimise). Use the gas price estimator (with optimiser enabled) to check! -* Make your state variables public - the compiler creates :ref:`getters ` for you automatically. -* If you end up checking conditions on input or state a lot at the beginning of your functions, try using :ref:`modifiers`. -* Initialize storage structs with a single assignment: ``x = MyStruct({a: 1, b: 2});`` - -.. note:: - If the storage struct has tightly packed properties, initialize it with separate - assignments: ``x.a = 1; x.b = 2;``. In this way it will be easier for the - optimizer to update storage in one go, thus making assignment cheaper. - -********** -Cheatsheet -********** - -.. index:: precedence - -.. _order: - -Order of Precedence of Operators -================================ - -The following is the order of precedence for operators, listed in order of evaluation. - -+------------+-------------------------------------+--------------------------------------------+ -| Precedence | Description | Operator | -+============+=====================================+============================================+ -| *1* | Postfix increment and decrement | ``++``, ``--`` | -+ +-------------------------------------+--------------------------------------------+ -| | New expression | ``new `` | -+ +-------------------------------------+--------------------------------------------+ -| | Array subscripting | ``[]`` | -+ +-------------------------------------+--------------------------------------------+ -| | Member access | ``.`` | -+ +-------------------------------------+--------------------------------------------+ -| | Function-like call | ``()`` | -+ +-------------------------------------+--------------------------------------------+ -| | Parentheses | ``()`` | -+------------+-------------------------------------+--------------------------------------------+ -| *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 | `` ? : `` | -+ +-------------------------------------+--------------------------------------------+ -| | Assignment operators | ``=``, ``|=``, ``^=``, ``&=``, ``<<=``, | -| | | ``>>=``, ``+=``, ``-=``, ``*=``, ``/=``, | -| | | ``%=`` | -+------------+-------------------------------------+--------------------------------------------+ -| *15* | Comma operator | ``,`` | -+------------+-------------------------------------+--------------------------------------------+ - -.. index:: assert, block, coinbase, difficulty, number, block;number, timestamp, block;timestamp, msg, data, gas, sender, value, now, gas price, origin, revert, require, keccak256, ripemd160, sha256, ecrecover, addmod, mulmod, cryptography, this, super, selfdestruct, balance, send - -Global Variables -================ - -- ``abi.decode(bytes memory encodedData, (...)) returns (...)``: :ref:`ABI `-decodes - the provided data. The types are given in parentheses as second argument. - Example: ``(uint a, uint[2] memory b, bytes memory c) = abi.decode(data, (uint, uint[2], bytes))`` -- ``abi.encode(...) returns (bytes memory)``: :ref:`ABI `-encodes the given arguments -- ``abi.encodePacked(...) returns (bytes memory)``: Performs :ref:`packed encoding ` of - the given arguments. Note that this encoding can be ambiguous! -- ``abi.encodeWithSelector(bytes4 selector, ...) returns (bytes memory)``: :ref:`ABI `-encodes - the given arguments starting from the second and prepends the given four-byte selector -- ``abi.encodeWithSignature(string memory signature, ...) returns (bytes memory)``: Equivalent - to ``abi.encodeWithSelector(bytes4(keccak256(bytes(signature)), ...)``` -- ``block.coinbase`` (``address payable``): current block miner's address -- ``block.difficulty`` (``uint``): current block difficulty -- ``block.gaslimit`` (``uint``): current block gaslimit -- ``block.number`` (``uint``): current block number -- ``block.timestamp`` (``uint``): current block timestamp -- ``gasleft() returns (uint256)``: remaining gas -- ``msg.data`` (``bytes``): complete calldata -- ``msg.sender`` (``address payable``): sender of the message (current call) -- ``msg.value`` (``uint``): number of wei sent with the message -- ``now`` (``uint``): current block timestamp (alias for ``block.timestamp``) -- ``tx.gasprice`` (``uint``): gas price of the transaction -- ``tx.origin`` (``address payable``): sender of the transaction (full call chain) -- ``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) -- ``require(bool condition, string memory message)``: abort execution and revert state changes if - 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 -- ``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 -- ``ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) returns (address)``: recover address associated with - the public key from elliptic curve signature, return zero on error -- ``addmod(uint x, uint y, uint k) returns (uint)``: compute ``(x + y) % k`` where the addition is performed with - 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. -- ``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 -- ``selfdestruct(address payable recipient)``: destroy the current contract, sending its funds to the given address -- ``
.balance`` (``uint256``): balance of the :ref:`address` in Wei -- ``
.send(uint256 amount) returns (bool)``: send given amount of Wei to :ref:`address`, - returns ``false`` on failure -- ``
.transfer(uint256 amount)``: send given amount of Wei to :ref:`address`, throws on failure -- ``type(C).name`` (``string``): the name of the contract -- ``type(C).creationCode`` (``bytes memory``): creation bytecode of the given contract, see :ref:`Type Information`. -- ``type(C).runtimeCode`` (``bytes memory``): runtime bytecode of the given contract, see :ref:`Type Information`. - -.. note:: - Do not rely on ``block.timestamp``, ``now`` and ``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``. - -.. index:: visibility, public, private, external, internal - -Function Visibility Specifiers -============================== - -:: - - function myFunction() returns (bool) { - return true; - } - -- ``public``: visible externally and internally (creates a :ref:`getter function` for storage/state variables) -- ``private``: only visible in the current contract -- ``external``: only visible externally (only for functions) - i.e. can only be message-called (via ``this.func``) -- ``internal``: only visible internally - - -.. index:: modifiers, pure, view, payable, constant, anonymous, indexed - -Modifiers -========= - -- ``pure`` for functions: Disallows modification or access of state. -- ``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. -- ``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. -- ``override``: States that this function, modifier or public state variable changes - the behaviour 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``, ``case``, ``copyof``, ``default``, -``define``, ``final``, ``immutable``, ``implements``, ``in``, ``inline``, ``let``, ``macro``, ``match``, -``mutable``, ``null``, ``of``, ``partial``, ``promise``, ``reference``, ``relocatable``, -``sealed``, ``sizeof``, ``static``, ``supports``, ``switch``, ``typedef``, ``typeof``, -``unchecked``. - -Language Grammar -================ - -.. literalinclude:: grammar.txt - :language: none diff --git a/compiler/docs/natspec-format.rst b/compiler/docs/natspec-format.rst index ae429580..28848dae 100644 --- a/compiler/docs/natspec-format.rst +++ b/compiler/docs/natspec-format.rst @@ -8,6 +8,13 @@ Solidity contracts can use a special form of comments to provide rich documentation for functions, return variables and more. This special form is named the Ethereum Natural Language Specification Format (NatSpec). +.. note:: + + NatSpec was inspired by `Doxygen `_. + While it uses Doxygen-style comments and tags, there is no intention to keep + strict compatibility with Doxygen. Please carefully examine the supported tags + listed below. + This documentation is segmented into developer-focused messages and end-user-facing messages. These messages may be shown to the end user (the human) at the time that they will interact with the contract (i.e. sign a transaction). @@ -20,50 +27,79 @@ use, and which are understood by the Solidity compiler. Also detailed below is output of the Solidity compiler, which extracts these comments into a machine-readable format. +NatSpec may also include annotations used by third-party tools. These are most likely +accomplished via the ``@custom:`` tag, and a good use case is analysis and verification +tools. + .. _header-doc-example: Documentation Example ===================== -Documentation is inserted above each ``class``, ``interface`` and -``function`` using the doxygen notation format. +Documentation is inserted above each ``contract``, ``interface``, ``library``, +``function``, and ``event`` using the Doxygen notation format. +A ``public`` state variable is equivalent to a ``function`` +for the purposes of NatSpec. - For Solidity you may choose ``///`` for single or multi-line comments, or ``/**`` and ending with ``*/``. - For Vyper, use ``"""`` indented to the inner contents with bare - comments. See `Vyper - documentation `__. + comments. See the `Vyper + documentation `__. The following example shows a contract and a function using all available tags. .. note:: - NatSpec currently does NOT apply to public state variables (see - `solidity#3418 `__), - even if they are declared public and therefore do affect the ABI. - The Solidity compiler only interprets tags if they are external or public. You are welcome to use similar comments for your internal and private functions, but those will not be parsed. -.. code:: solidity + This may change in the future. - pragma solidity >=0.5.0 <0.7.0; +.. code-block:: Solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.8.2 < 0.9.0; /// @title A simulator for trees /// @author Larry A. Gardner /// @notice You can use this contract for only the most basic simulation /// @dev All function calls are currently implemented without side effects + /// @custom:experimental This is an experimental contract. contract Tree { - /// @author Mary A. Botanist /// @notice Calculate tree age in years, rounded up, for live trees /// @dev The Alexandr N. Tetearing algorithm could increase precision /// @param rings The number of rings from dendrochronological sample - /// @return age in years, rounded up for partial years - function age(uint256 rings) external pure returns (uint256) { + /// @return Age in years, rounded up for partial years + function age(uint256 rings) external virtual pure returns (uint256) { return rings + 1; } + + /// @notice Returns the amount of leaves the tree has. + /// @dev Returns only a fixed number. + function leaves() external virtual pure returns(uint256) { + return 2; + } + } + + contract Plant { + function leaves() external virtual pure returns(uint256) { + return 3; + } + } + + contract KumquatTree is Tree, Plant { + function age(uint256 rings) external override pure returns (uint256) { + return rings + 2; + } + + /// Return the amount of leaves that this specific kind of tree has + /// @inheritdoc Tree + function leaves() external override(Tree, Plant) pure returns(uint256) { + return 3; + } } .. _header-tags: @@ -73,23 +109,27 @@ Tags All tags are optional. The following table explains the purpose of each NatSpec tag and where it may be used. As a special case, if no tags are -used then the Solidity compiler will interpret a `///` or `/**` comment -in the same way as if it were tagged with `@notice`. - -=========== =============================================================================== ============================= -Tag Context -=========== =============================================================================== ============================= -``@title`` A title that should describe the contract/interface contract, interface -``@author`` The name of the author contract, interface, function -``@notice`` Explain to an end user what this does contract, interface, function -``@dev`` Explain to a developer any extra details contract, interface, function -``@param`` Documents a parameter just like in doxygen (must be followed by parameter name) function -``@return`` Documents the return variables of a contract's function function -=========== =============================================================================== ============================= +used then the Solidity compiler will interpret a ``///`` or ``/**`` comment +in the same way as if it were tagged with ``@notice``. + +=============== ====================================================================================== ============================= +Tag Context +=============== ====================================================================================== ============================= +``@title`` A title that should describe the contract/interface contract, library, interface +``@author`` The name of the author contract, library, interface +``@notice`` Explain to an end user what this does contract, library, interface, function, public state variable, event +``@dev`` Explain to a developer any extra details contract, library, interface, function, state variable, event +``@param`` Documents a parameter just like in Doxygen (must be followed by parameter name) function, event +``@return`` Documents the return variables of a contract's function function, public state variable +``@inheritdoc`` Copies all missing tags from the base function (must be followed by the contract name) function, public state variable +``@custom:...`` Custom tag, semantics is application-defined everywhere +=============== ====================================================================================== ============================= If your function returns multiple values, like ``(int quotient, int remainder)`` -then use multiple ``@return`` statements in the same format as the -``@param`` statements. +then use multiple ``@return`` statements in the same format as the ``@param`` statements. + +Custom tags start with ``@custom:`` and must be followed by one or more lowercase letters or hyphens. +It cannot start with a hyphen however. They can be used everywhere and are part of the developer documentation. .. _header-dynamic: @@ -102,7 +142,7 @@ JSON output, for example the end-user client software, may present this to the e For example, some client software will render: -.. code:: solidity +.. code:: Solidity /// @notice This function will multiply `a` by 7 @@ -123,9 +163,12 @@ documentation and you may read more at Inheritance Notes ----------------- -Currently it is undefined whether a contract with a function having no -NatSpec will inherit the NatSpec of a parent contract/interface for that -same function. +Functions without NatSpec will automatically inherit the documentation of their +base function. Exceptions to this are: + +* When the parameter names are different. +* When there is more than one base function. +* When there is an explicit ``@inheritdoc`` tag which specifies which contract should be used to inherit. .. _header-output: @@ -140,12 +183,17 @@ other to be used by the developer. If the above contract is saved as ``ex1.sol`` then you can generate the documentation using: -.. code:: +.. code-block:: shell solc --userdoc --devdoc ex1.sol And the output is below. +.. note:: + Starting Solidity version 0.6.11 the NatSpec output also contains a ``version`` and a ``kind`` field. + Currently the ``version`` is set to ``1`` and ``kind`` must be one of ``user`` or ``dev``. + In the future it is possible that new versions will be introduced, deprecating older ones. + .. _header-user-doc: User Documentation @@ -154,9 +202,11 @@ User Documentation The above documentation will produce the following user documentation JSON file as output: -.. code:: +.. code-block:: json { + "version" : 1, + "kind" : "user", "methods" : { "age(uint256)" : @@ -168,8 +218,8 @@ JSON file as output: } Note that the key by which to find the methods is the function's -canonical signature as defined in the `Contract -ABI `__ and not simply the function's +canonical signature as defined in the :ref:`Contract +ABI ` and not simply the function's name. .. _header-developer-doc: @@ -180,16 +230,18 @@ Developer Documentation Apart from the user documentation file, a developer documentation JSON file should also be produced and should look like this: -.. code:: +.. code-block:: json { + "version" : 1, + "kind" : "dev", "author" : "Larry A. Gardner", "details" : "All function calls are currently implemented without side effects", + "custom:experimental" : "This is an experimental contract.", "methods" : { "age(uint256)" : { - "author" : "Mary A. Botanist", "details" : "The Alexandr N. Tetearing algorithm could increase precision", "params" : { diff --git a/compiler/docs/path-resolution.rst b/compiler/docs/path-resolution.rst new file mode 100644 index 00000000..40a72706 --- /dev/null +++ b/compiler/docs/path-resolution.rst @@ -0,0 +1,667 @@ +.. _path-resolution: + +********************** +Import Path Resolution +********************** + +In order to be able to support reproducible builds on all platforms, the Solidity compiler has to +abstract away the details of the filesystem where source files are stored. +Paths used in imports must work the same way everywhere while the command-line interface must be +able to work with platform-specific paths to provide good user experience. +This section aims to explain in detail how Solidity reconciles these requirements. + +.. index:: ! virtual filesystem, ! VFS, ! source unit name +.. _virtual-filesystem: + +Virtual Filesystem +================== + +The compiler maintains an internal database (*virtual filesystem* or *VFS* for short) where each +source unit is assigned a unique *source unit name* which is an opaque and unstructured identifier. +When you use the :ref:`import statement `, you specify an *import path* that references a +source unit name. + +.. index:: ! import callback, ! Host Filesystem Loader +.. _import-callback: + +Import Callback +--------------- + +The VFS is initially populated only with files the compiler has received as input. +Additional files can be loaded during compilation using an *import callback*, which is different +depending on the type of compiler you use (see below). +If the compiler does not find any source unit name matching the import path in the VFS, it invokes +the callback, which is responsible for obtaining the source code to be placed under that name. +An import callback is free to interpret source unit names in an arbitrary way, not just as paths. +If there is no callback available when one is needed or if it fails to locate the source code, +compilation fails. + +The command-line compiler provides the *Host Filesystem Loader* - a rudimentary callback +that interprets a source unit name as a path in the local filesystem. +The `JavaScript interface `_ does not provide any by default, +but one can be provided by the user. +This mechanism can be used to obtain source code from locations other then the local filesystem +(which may not even be accessible, e.g. when the compiler is running in a browser). +For example the `Remix IDE `_ provides a versatile callback that +lets you `import files from HTTP, IPFS and Swarm URLs or refer directly to packages in NPM registry +`_. + +.. note:: + + Host Filesystem Loader's file lookup is platform-dependent. + For example backslashes in a source unit name can be interpreted as directory separators or not + and the lookup can be case-sensitive or not, depending on the underlying platform. + + For portability it is recommended to avoid using import paths that will work correctly only + with a specific import callback or only on one platform. + For example you should always use forward slashes since they work as path separators also on + platforms that support backslashes. + +Initial Content of the Virtual Filesystem +----------------------------------------- + +The initial content of the VFS depends on how you invoke the compiler: + +#. **solc / command-line interface** + + When you compile a file using the command-line interface of the compiler, you provide one or + more paths to files containing Solidity code: + + .. code-block:: bash + + solc contract.sol /usr/local/dapp-bin/token.sol + + The source unit name of a file loaded this way is constructed by converting its path to a + canonical form and, if possible, making it relative to either the base path or one of the + include paths. + See :ref:`CLI Path Normalization and Stripping ` for + a detailed description of this process. + + .. index:: standard JSON + +#. **Standard JSON** + + When using the :ref:`Standard JSON ` API (via either the `JavaScript interface + `_ or the ``--standard-json`` command-line option) + you provide input in JSON format, containing, among other things, the content of all your source + files: + + .. code-block:: json + + { + "language": "Solidity", + "sources": { + "contract.sol": { + "content": "import \"./util.sol\";\ncontract C {}" + }, + "util.sol": { + "content": "library Util {}" + }, + "/usr/local/dapp-bin/token.sol": { + "content": "contract Token {}" + } + }, + "settings": {"outputSelection": {"*": { "*": ["metadata", "evm.bytecode"]}}} + } + + The ``sources`` dictionary becomes the initial content of the virtual filesystem and its keys + are used as source unit names. + + .. _initial-vfs-content-standard-json-with-import-callback: + +#. **Standard JSON (via import callback)** + + With Standard JSON it is also possible to tell the compiler to use the import callback to obtain + the source code: + + .. code-block:: json + + { + "language": "Solidity", + "sources": { + "/usr/local/dapp-bin/token.sol": { + "urls": [ + "/projects/mytoken.sol", + "https://example.com/projects/mytoken.sol" + ] + } + }, + "settings": {"outputSelection": {"*": { "*": ["metadata", "evm.bytecode"]}}} + } + + If an import callback is available, the compiler will give it the strings specified in + ``urls`` one by one, until one is loaded successfully or the end of the list is reached. + + The source unit names are determined the same way as when using ``content`` - they are keys of + the ``sources`` dictionary and the content of ``urls`` does not affect them in any way. + + .. index:: standard input, stdin, + +#. **Standard input** + + On the command line it is also possible to provide the source by sending it to compiler's + standard input: + + .. code-block:: bash + + echo 'import "./util.sol"; contract C {}' | solc - + + ``-`` used as one of the arguments instructs the compiler to place the content of the standard + input in the virtual filesystem under a special source unit name: ````. + +Once the VFS is initialized, additional files can still be added to it only through the import +callback. + +.. index:: ! import; path + +Imports +======= + +The import statement specifies an *import path*. +Based on how the import path is specified, we can divide imports into two categories: + +- :ref:`Direct imports `, where you specify the full source unit name directly. +- :ref:`Relative imports `, where you specify a path starting with ``./`` or ``../`` + to be combined with the source unit name of the importing file. + + +.. code-block:: solidity + :caption: contracts/contract.sol + + import "./math/math.sol"; + import "contracts/tokens/token.sol"; + +In the above ``./math/math.sol`` and ``contracts/tokens/token.sol`` are import paths while the +source unit names they translate to are ``contracts/math/math.sol`` and ``contracts/tokens/token.sol`` +respectively. + +.. index:: ! direct import, import; direct +.. _direct-imports: + +Direct Imports +-------------- + +An import that does not start with ``./`` or ``../`` is a *direct import*. + +.. code-block:: solidity + + import "/project/lib/util.sol"; // source unit name: /project/lib/util.sol + import "lib/util.sol"; // source unit name: lib/util.sol + import "@openzeppelin/address.sol"; // source unit name: @openzeppelin/address.sol + import "https://example.com/token.sol"; // source unit name: https://example.com/token.sol + +After applying any :ref:`import remappings ` the import path simply becomes the +source unit name. + +.. note:: + + A source unit name is just an identifier and even if its value happens to look like a path, it + is not subject to the normalization rules you would typically expect in a shell. + Any ``/./`` or ``/../`` seguments or sequences of multiple slashes remain a part of it. + When the source is provided via Standard JSON interface it is entirely possible to associate + different content with source unit names that would refer to the same file on disk. + +When the source is not available in the virtual filesystem, the compiler passes the source unit name +to the import callback. +The Host Filesystem Loader will attempt to use it as a path and look up the file on disk. +At this point the platform-specific normalization rules kick in and names that were considered +different in the VFS may actually result in the same file being loaded. +For example ``/project/lib/math.sol`` and ``/project/lib/../lib///math.sol`` are considered +completely different in the VFS even though they refer to the same file on disk. + +.. note:: + + Even if an import callback ends up loading source code for two different source unit names from + the same file on disk, the compiler will still see them as separate source units. + It is the source unit name that matters, not the physical location of the code. + +.. index:: ! relative import, ! import; relative +.. _relative-imports: + +Relative Imports +---------------- + +An import starting with ``./`` or ``../`` is a *relative import*. +Such imports specify a path relative to the source unit name of the importing source unit: + +.. code-block:: solidity + :caption: /project/lib/math.sol + + import "./util.sol" as util; // source unit name: /project/lib/util.sol + import "../token.sol" as token; // source unit name: /project/token.sol + +.. code-block:: solidity + :caption: lib/math.sol + + import "./util.sol" as util; // source unit name: lib/util.sol + import "../token.sol" as token; // source unit name: token.sol + +.. note:: + + Relative imports **always** start with ``./`` or ``../`` so ``import "util.sol"``, unlike + ``import "./util.sol"``, is a direct import. + While both paths would be considered relative in the host filesystem, ``util.sol`` is actually + absolute in the VFS. + +Let us define a *path segment* as any non-empty part of the path that does not contain a separator +and is bounded by two path separators. +A separator is a forward slash or the beginning/end of the string. +For example in ``./abc/..//`` there are three path segments: ``.``, ``abc`` and ``..``. + +The compiler computes a source unit name from the import path in the following way: + +1. First a prefix is computed + + - Prefix is initialized with the source unit name of the importing source unit. + - The last path segment with preceding slashes is removed from the prefix. + - Then, the leading part of the normalized import path, consisting only of ``/`` and ``.`` + characters is considered. + For every ``..`` segment found in this part the last path segment with preceding slashes is + removed from the prefix. + +2. Then the prefix is prepended to the normalized import path. + If the prefix is non-empty, a single slash is inserted between it and the import path. + +The removal of the last path segment with preceding slashes is understood to +work as follows: + +1. Everything past the last slash is removed (i.e. ``a/b//c.sol`` becomes ``a/b//``). +2. All trailing slashes are removed (i.e. ``a/b//`` becomes ``a/b``). + +The normalization rules are the same as for UNIX paths, namely: + +- All the internal ``.`` segments are removed. +- Every internal ``..`` segment backtracks one level up in the hierarchy. +- Multiple slashes are squashed into a single one. + +Note that normalization is performed only on the import path. +The source unit name of the importing module that is used for the prefix remains unnormalized. +This ensures that the ``protocol://`` part does not turn into ``protocol:/`` if the importing file +is identified with a URL. + +If your import paths are already normalized, you can expect the above algorithm to produce very +intuitive results. +Here are some examples of what you can expect if they are not: + +.. code-block:: solidity + :caption: lib/src/../contract.sol + + import "./util/./util.sol"; // source unit name: lib/src/../util/util.sol + import "./util//util.sol"; // source unit name: lib/src/../util/util.sol + import "../util/../array/util.sol"; // source unit name: lib/src/array/util.sol + import "../.././../util.sol"; // source unit name: util.sol + import "../../.././../util.sol"; // source unit name: util.sol + +.. note:: + + The use of relative imports containing leading ``..`` segments is not recommended. + The same effect can be achieved in a more reliable way by using direct imports with + :ref:`base path and include paths `. + +.. index:: ! base path, ! --base-path, ! include paths, ! --include-path +.. _base-and-include-paths: + +Base Path and Include Paths +=========================== + +The base path and include paths represent directories that the Host Filesystem Loader will load files from. +When a source unit name is passed to the loader, it prepends the base path to it and performs a +filesystem lookup. +If the lookup does not succeed, the same is done with all directories on the include path list. + +It is recommended to set the base path to the root directory of your project and use include paths to +specify additional locations that may contain libraries your project depends on. +This lets you import from these libraries in a uniform way, no matter where they are located in the +filesystem relative to your project. +For example, if you use npm to install packages and your contract imports +``@openzeppelin/contracts/utils/Strings.sol``, you can use these options to tell the compiler that +the library can be found in one of the npm package directories: + +.. code-block:: bash + + solc contract.sol \ + --base-path . \ + --include-path node_modules/ \ + --include-path /usr/local/lib/node_modules/ + +Your contract will compile (with the same exact metadata) no matter whether you install the library +in the local or global package directory or even directly under your project root. + +By default the base path is empty, which leaves the source unit name unchanged. +When the source unit name is a relative path, this results in the file being looked up in the +directory the compiler has been invoked from. +It is also the only value that results in absolute paths in source unit names being actually +interpreted as absolute paths on disk. +If the base path itself is relative, it is interpreted as relative to the current working directory +of the compiler. + +.. note:: + + Include paths cannot have empty values and must be used together with a non-empty base path. + +.. note:: + + Include paths and base path can overlap as long as it does not make import resolution ambiguous. + For example, you can specify a directory inside base path as an include directory or have an + include directory that is a subdirectory of another include directory. + The compiler will only issue an error if the source unit name passed to the Host Filesystem + Loader represents an existing path when combined with multiple include paths or an include path + and base path. + +.. _cli-path-normalization-and-stripping: + +CLI Path Normalization and Stripping +------------------------------------ + +On the command line the compiler behaves just as you would expect from any other program: +it accepts paths in a format native to the platform and relative paths are relative to the current +working directory. +The source unit names assigned to files whose paths are specified on the command line, however, +should not change just because the project is being compiled on a different platform or because the +compiler happens to have been invoked from a different directory. +To achieve this, paths to source files coming from the command line must be converted to a canonical +form, and, if possible, made relative to the base path or one of the include paths. + +The normalization rules are as follows: + +- If a path is relative, it is made absolute by prepending the current working directory to it. +- Internal ``.`` and ``..`` segments are collapsed. +- Platform-specific path separators are replaced with forward slashes. +- Sequences of multiple consecutive path separators are squashed into a single separator (unless + they are the leading slashes of an `UNC path `_). +- If the path includes a root name (e.g. a drive letter on Windows) and the root is the same as the + root of the current working directory, the root is replaced with ``/``. +- Symbolic links in the path are **not** resolved. + + - The only exception is the path to the current working directory prepended to relative paths in + the process of making them absolute. + On some platforms the working directory is reported always with symbolic links resolved so for + consistency the compiler resolves them everywhere. + +- The original case of the path is preserved even if the filesystem is case-insensitive but + `case-preserving `_ and the actual case on + disk is different. + +.. note:: + + There are situations where paths cannot be made platform-independent. + For example on Windows the compiler can avoid using drive letters by referring to the root + directory of the current drive as ``/`` but drive letters are still necessary for paths leading + to other drives. + You can avoid such situations by ensuring that all the files are available within a single + directory tree on the same drive. + +After normalization the compiler attempts to make the source file path relative. +It tries the base path first and then the include paths in the order they were given. +If the base path is empty or not specified, it is treated as if it was equal to the path to the +current working directory (with all symbolic links resolved). +The result is accepted only if the normalized directory path is the exact prefix of the normalized +file path. +Otherwise the file path remains absolute. +This makes the conversion unambiguous and ensures that the relative path does not start with ``../``. +The resulting file path becomes the source unit name. + +.. note:: + + The relative path produced by stripping must remain unique within the base path and include paths. + For example the compiler will issue an error for the following command if both + ``/project/contract.sol`` and ``/lib/contract.sol`` exist: + + .. code-block:: bash + + solc /project/contract.sol --base-path /project --include-path /lib + +.. note:: + + Prior to version 0.8.8, CLI path stripping was not performed and the only normalization applied + was the conversion of path separators. + When working with older versions of the compiler it is recommended to invoke the compiler from + the base path and to only use relative paths on the command line. + +.. index:: ! allowed paths, ! --allow-paths, remapping; target +.. _allowed-paths: + +Allowed Paths +============= + +As a security measure, the Host Filesystem Loader will refuse to load files from outside of a few +locations that are considered safe by default: + +- Outside of Standard JSON mode: + + - The directories containing input files listed on the command line. + - The directories used as :ref:`remapping ` targets. + If the target is not a directory (i.e does not end with ``/``, ``/.`` or ``/..``) the directory + containing the target is used instead. + - Base path and include paths. + +- In Standard JSON mode: + + - Base path and include paths. + +Additional directories can be whitelisted using the ``--allow-paths`` option. +The option accepts a comma-separated list of paths: + +.. code-block:: bash + + cd /home/user/project/ + solc token/contract.sol \ + lib/util.sol=libs/util.sol \ + --base-path=token/ \ + --include-path=/lib/ \ + --allow-paths=../utils/,/tmp/libraries + +When the compiler is invoked with the command shown above, the Host Filesystem Loader will allow +importing files from the following directories: + +- ``/home/user/project/token/`` (because ``token/`` contains the input file and also because it is + the base path), +- ``/lib/`` (because ``/lib/`` is one of the include paths), +- ``/home/user/project/libs/`` (because ``libs/`` is a directory containing a remapping target), +- ``/home/user/utils/`` (because of ``../utils/`` passed to ``--allow-paths``), +- ``/tmp/libraries/`` (because of ``/tmp/libraries`` passed to ``--allow-paths``), + +.. note:: + + The working directory of the compiler is one of the paths allowed by default only if it + happens to be the base path (or the base path is not specified or has an empty value). + +.. note:: + + The compiler does not check if allowed paths actually exist and whether they are directories. + Non-existent or empty paths are simply ignored. + If an allowed path matches a file rather than a directory, the file is considered whitelisted, too. + +.. note:: + + Allowed paths are case-sensitive even if the filesystem is not. + The case must exactly match the one used in your imports. + For example ``--allow-paths tokens`` will not match ``import "Tokens/IERC20.sol"``. + +.. warning:: + + Files and directories only reachable through symbolic links from allowed directories are not + automatically whitelisted. + For example if ``token/contract.sol`` in the example above was actually a symlink pointing at + ``/etc/passwd`` the compiler would refuse to load it unless ``/etc/`` was one of the allowed + paths too. + +.. index:: ! remapping; import, ! import; remapping, ! remapping; context, ! remapping; prefix, ! remapping; target +.. _import-remapping: + +Import Remapping +================ + +Import remapping allows you to redirect imports to a different location in the virtual filesystem. +The mechanism works by changing the translation between import paths and source unit names. +For example you can set up a remapping so that any import from the virtual directory +``github.com/ethereum/dapp-bin/library/`` would be seen as an import from ``dapp-bin/library/`` instead. + +You can limit the scope of a remapping by specifying a *context*. +This allows creating remappings that apply only to imports located in a specific library or a specific file. +Without a context a remapping is applied to every matching import in all the files in the virtual +filesystem. + +Import remappings have the form of ``context:prefix=target``: + +- ``context`` must match the beginning of the source unit name of the file containing the import. +- ``prefix`` must match the beginning of the source unit name resulting from the import. +- ``target`` is the value the prefix is replaced with. + +For example, if you clone https://github.com/ethereum/dapp-bin/ locally to ``/project/dapp-bin`` +and run the compiler with: + +.. code-block:: bash + + solc github.com/ethereum/dapp-bin/=dapp-bin/ --base-path /project source.sol + +you can use the following in your source file: + +.. code-block:: solidity + + import "github.com/ethereum/dapp-bin/library/math.sol"; // source unit name: dapp-bin/library/math.sol + +The compiler will look for the file in the VFS under ``dapp-bin/library/math.sol``. +If the file is not available there, the source unit name will be passed to the Host Filesystem +Loader, which will then look in ``/project/dapp-bin/library/iterable_mapping.sol``. + +.. warning:: + + Information about remappings is stored in contract metadata. + Since the binary produced by the compiler has a hash of the metadata embedded in it, any + modification to the remappings will result in different bytecode. + + For this reason you should be careful not to include any local information in remapping targets. + For example if your library is located in ``/home/user/packages/mymath/math.sol``, a remapping + like ``@math/=/home/user/packages/mymath/`` would result in your home directory being included in + the metadata. + To be able to reproduce the same bytecode with such a remapping on a different machine, you + would need to recreate parts of your local directory structure in the VFS and (if you rely on + Host Filesystem Loader) also in the host filesystem. + + To avoid having your local directory structure embedded in the metadata, it is recommended to + designate the directories containing libraries as *include paths* instead. + For example, in the example above ``--include-path /home/user/packages/`` would let you use + imports starting with ``mymath/``. + Unlike remapping, the option on its own will not make ``mymath`` appear as ``@math`` but this + can be achieved by creating a symbolic link or renaming the package subdirectory. + +As a more complex example, suppose you rely on a module that uses an old version of dapp-bin that +you checked out to ``/project/dapp-bin_old``, then you can run: + +.. code-block:: bash + + solc module1:github.com/ethereum/dapp-bin/=dapp-bin/ \ + module2:github.com/ethereum/dapp-bin/=dapp-bin_old/ \ + --base-path /project \ + source.sol + +This means that all imports in ``module2`` point to the old version but imports in ``module1`` +point to the new version. + +Here are the detailed rules governing the behaviour of remappings: + +#. **Remappings only affect the translation between import paths and source unit names.** + + Source unit names added to the VFS in any other way cannot be remapped. + For example the paths you specify on the command-line and the ones in ``sources.urls`` in + Standard JSON are not affected. + + .. code-block:: bash + + solc /project/=/contracts/ /project/contract.sol # source unit name: /project/contract.sol + + In the example above the compiler will load the source code from ``/project/contract.sol`` and + place it under that exact source unit name in the VFS, not under ``/contract/contract.sol``. + +#. **Context and prefix must match source unit names, not import paths.** + + - This means that you cannot remap ``./`` or ``../`` directly since they are replaced during + the translation to source unit name but you can remap the part of the name they are replaced + with: + + .. code-block:: bash + + solc ./=a/ /project/=b/ /project/contract.sol # source unit name: /project/contract.sol + + .. code-block:: solidity + :caption: /project/contract.sol + + import "./util.sol" as util; // source unit name: b/util.sol + + - You cannot remap base path or any other part of the path that is only added internally by an + import callback: + + .. code-block:: bash + + solc /project/=/contracts/ /project/contract.sol --base-path /project # source unit name: contract.sol + + .. code-block:: solidity + :caption: /project/contract.sol + + import "util.sol" as util; // source unit name: util.sol + +#. **Target is inserted directly into the source unit name and does not necessarily have to be a valid path.** + + - It can be anything as long as the import callback can handle it. + In case of the Host Filesystem Loader this includes also relative paths. + When using the JavaScript interface you can even use URLs and abstract identifiers if + your callback can handle them. + + - Remapping happens after relative imports have already been resolved into source unit names. + This means that targets starting with ``./`` and ``../`` have no special meaning and are + relative to the base path rather than to the location of the source file. + + - Remapping targets are not normalized so ``@root/=./a/b//`` will remap ``@root/contract.sol`` + to ``./a/b//contract.sol`` and not ``a/b/contract.sol``. + + - If the target does not end with a slash, the compiler will not add one automatically: + + .. code-block:: bash + + solc /project/=/contracts /project/contract.sol # source unit name: /project/contract.sol + + .. code-block:: solidity + :caption: /project/contract.sol + + import "/project/util.sol" as util; // source unit name: /contractsutil.sol + +#. **Context and prefix are patterns and matches must be exact.** + + - ``a//b=c`` will not match ``a/b``. + - source unit names are not normalized so ``a/b=c`` will not match ``a//b`` either. + - Parts of file and directory names can match as well. + ``/newProject/con:/new=old`` will match ``/newProject/contract.sol`` and remap it to + ``oldProject/contract.sol``. + +#. **At most one remapping is applied to a single import.** + + - If multiple remappings match the same source unit name, the one with the longest matching + prefix is chosen. + - If prefixes are identical, the one specified last wins. + - Remappings do not work on other remappings. For example ``a=b b=c c=d`` will not result in ``a`` + being remapped to ``d``. + +#. **Prefix cannot be empty but context and target are optional.** + + - If ``target`` is the empty string, ``prefix`` is simply removed from import paths. + - Empty ``context`` means that the remapping applies to all imports in all source units. + +.. index:: Remix IDE, file:// + +Using URLs in imports +===================== + +Most URL prefixes such as ``https://`` or ``data://`` have no special meaning in import paths. +The only exception is ``file://`` which is stripped from source unit names by the Host Filesystem +Loader. + +When compiling locally you can use import remapping to replace the protocol and domain part with a +local path: + +.. code-block:: bash + + solc :https://github.com/ethereum/dapp-bin=/usr/local/dapp-bin contract.sol + +Note the leading ``:``, which is necessary when the remapping context is empty. +Otherwise the ``https:`` part would be interpreted by the compiler as the context. diff --git a/compiler/docs/requirements.txt b/compiler/docs/requirements.txt index 5fba631c..23c8f904 100644 --- a/compiler/docs/requirements.txt +++ b/compiler/docs/requirements.txt @@ -1,2 +1,10 @@ -sphinx_rtd_theme>=0.3.1 -pygments-lexer-solidity>=0.3.1 +# Older versions of sphinx-rtd-theme do not work with never docutils but have a bug in the dependency +# which could result in it being installed anyway and the style (especially bullet points) being broken. +# See https://github.com/readthedocs/sphinx_rtd_theme/issues/1115 +sphinx_rtd_theme>=0.5.2 + +pygments-lexer-solidity>=0.7.0 +sphinx-a4doc>=1.2.1 + +# Sphinx 2.1.0 is the oldest version that accepts a lexer class in add_lexer() +sphinx>=2.1.0 diff --git a/compiler/docs/resources.rst b/compiler/docs/resources.rst index 02c1930a..c70b35fb 100644 --- a/compiler/docs/resources.rst +++ b/compiler/docs/resources.rst @@ -1,45 +1,49 @@ +######### Resources ---------- +######### -General -~~~~~~~ +General Resources +================= -* `Ethereum `_ +* `Ethereum.org Developer Portal `_ +* `Ethereum StackExchange `_ +* `Solidity Portal `_ +* `Solidity Changelog `_ +* `Solidity Source Code on GitHub `_ +* `Solidity Language Users Chat `_ +* `Solidity Compiler Developers Chat `_ +* `Awesome Solidity `_ +* `Solidity by Example `_ +* `Solidity Documentation Community Translations `_ -* `Changelog `_ +Integrated (Ethereum) Development Environments +============================================== -* `Source Code `_ + * `Brownie `_ + Python-based development and testing framework for smart contracts targeting the Ethereum Virtual Machine. -* `Ethereum Stackexchange `_ + * `Dapp `_ + Tool for building, testing and deploying smart contracts from the command line. -* `Language Users Chat `_ + * `Embark `_ + Developer platform for building and deploying decentralized applications. -* `Compiler Developers Chat `_ + * `Foundry `_ + Fast, portable and modular toolkit for Ethereum application development written in Rust. -Solidity Integrations -~~~~~~~~~~~~~~~~~~~~~ - -* Generic: - - * `EthFiddle `_ - Solidity IDE in the Browser. Write and share your Solidity code. Uses server-side components. + * `Hardhat `_ + Ethereum development environment with local Ethereum network, debugging features and plugin ecosystem. * `Remix `_ Browser-based IDE with integrated compiler and Solidity runtime environment without server-side components. - * `Solhint `_ - Solidity linter that provides security, style guide and best practice rules for smart contract validation. - - * `Solidity IDE `_ - Browser-based IDE with integrated compiler, Ganache and local file system support. - - * `Ethlint `_ - Linter to identify and fix style and security issues in Solidity. + * `Truffle `_ + Ethereum development framework. - * `Superblocks Lab `_ - Browser-based IDE. Built-in browser-based VM and Metamask integration (one click deployment to Testnet/Mainnet). +Editor Integrations +=================== -* Atom: +* Atom * `Etheratom `_ Plugin for the Atom editor that features syntax highlighting, compilation and a runtime environment (Backend node & VM compatible). @@ -50,74 +54,73 @@ Solidity Integrations * `Atom Solium Linter `_ Configurable Solidity linter for Atom using Solium (now Ethlint) as a base. -* Eclipse: - - * `YAKINDU Solidity Tools `_ - Eclipse based IDE. Features context sensitive code completion and help, code navigation, syntax coloring, built in compiler, quick fixes and templates. - -* Emacs: +* Emacs * `Emacs Solidity `_ Plugin for the Emacs editor providing syntax highlighting and compilation error reporting. -* IntelliJ: +* IntelliJ * `IntelliJ IDEA plugin `_ Solidity plugin for IntelliJ IDEA (and all other JetBrains IDEs) -* Sublime: +* Sublime * `Package for SublimeText - Solidity language syntax `_ Solidity syntax highlighting for SublimeText editor. -* Vim: +* Vim * `Vim Solidity `_ Plugin for the Vim editor providing syntax highlighting. - * `Vim Syntastic `_ + * `Vim Syntastic `_ Plugin for the Vim editor providing compile checking. -* Visual Studio Code: +* Visual Studio Code - * `Visual Studio Code extension `_ + * `Visual Studio Code extension `_ Solidity plugin for Microsoft Visual Studio Code that includes syntax highlighting and the Solidity compiler. -Discontinued: - -* `Mix IDE `_ - Qt based IDE for designing, debugging and testing solidity smart contracts. - -* `Ethereum Studio `_ - Specialized web IDE that also provides shell access to a complete Ethereum environment. - -* `Visual Studio Extension `_ - Solidity plugin for Microsoft Visual Studio that includes the Solidity compiler. + * `Solidity Visual Auditor extension `_ + Adds security centric syntax and semantic highlighting to Visual Studio Code. Solidity Tools -~~~~~~~~~~~~~~ +============== * `ABI to Solidity interface converter `_ A script for generating contract interfaces from the ABI of a smart contract. -* `Dapp `_ - Build tool, package manager, and deployment assistant for Solidity. +* `abi-to-sol `_ + Tool to generate Solidity interface source from a given ABI JSON. * `Doxity `_ Documentation Generator for Solidity. +* `Ethlint `_ + Linter to identify and fix style and security issues in Solidity. + * `evmdis `_ EVM Disassembler that performs static analysis on the bytecode to provide a higher level of abstraction than raw EVM operations. * `EVM Lab `_ Rich tool package to interact with the EVM. Includes a VM, Etherchain API, and a trace-viewer with gas cost display. +* `hevm `_ + EVM debugger and symbolic execution engine. + * `leafleth `_ A documentation generator for Solidity smart-contracts. * `PIET `_ A tool to develop, audit and use Solidity smart contracts through a simple graphical interface. +* `Scaffold-ETH `_ + Forkable Ethereum development stack focused on fast product iterations. + +* `sol2uml `_ + Unified Modeling Language (UML) class diagram generator for Solidity contracts. + * `solc-select `_ A script to quickly switch between Solidity compiler versions. @@ -130,8 +133,11 @@ Solidity Tools * `solgraph `_ Visualize Solidity control flow and highlight potential security vulnerabilities. -* `Securify `_ - Fully automated online static analyzer for smart contracts, providing a security report based on vulnerability patterns. +* `Solhint `_ + Solidity linter that provides security, style guide and best practice rules for smart contract validation. + +* `Sourcify `_ + Decentralized automated contract verification service and public repository of contract metadata. * `Sūrya `_ Utility tool for smart contract systems, offering a number of visual outputs and information about the contracts' structure. Also supports querying the function call graph. @@ -140,10 +146,7 @@ Solidity Tools A tool for mutation generation, with configurable rules and support for Solidity and Vyper. Third-Party Solidity Parsers and Grammars -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -* `solidity-parser `_ - Solidity parser for JavaScript +========================================= -* `Solidity Grammar for ANTLR 4 `_ - Solidity grammar for the ANTLR 4 parser generator +* `Solidity Parser for JavaScript `_ + A Solidity parser for JS built on top of a robust ANTLR4 grammar. diff --git a/compiler/docs/robots.txt.template b/compiler/docs/robots.txt.template new file mode 100644 index 00000000..3b7431d7 --- /dev/null +++ b/compiler/docs/robots.txt.template @@ -0,0 +1,15 @@ +User-Agent: * +Sitemap: http://docs.soliditylang.org/sitemap.xml +Host: docs.soliditylang.org + +Allow: /en/latest/ +Allow: /en/v0.7.6/ +Allow: /en/v{{ LATEST_VERSION }}/ +Allow: /_/downloads/en/latest/ +Allow: /_/downloads/en/0.7.6/ +Allow: /_/downloads/en/{{ LATEST_VERSION }}/ + +# Prevent documentation for the development branches and older Solidity +# versions from showing up in search results. +Disallow: /en/* +Disallow: /_/downloads/en/* diff --git a/compiler/docs/security-considerations.rst b/compiler/docs/security-considerations.rst index ebf54b3a..6507f7c1 100644 --- a/compiler/docs/security-considerations.rst +++ b/compiler/docs/security-considerations.rst @@ -56,17 +56,18 @@ to call back into A before this interaction is completed. To give an example, the following code contains a bug (it is just a snippet and not a complete contract): -:: +.. code-block:: solidity - pragma solidity >=0.4.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.0 <0.9.0; // THIS CONTRACT CONTAINS A BUG - DO NOT USE contract Fund { - /// Mapping of ether shares of the contract. + /// @dev Mapping of ether shares of the contract. mapping(address => uint) shares; /// Withdraw your share. function withdraw() public { - if (msg.sender.send(shares[msg.sender])) + if (payable(msg.sender).send(shares[msg.sender])) shares[msg.sender] = 0; } } @@ -79,13 +80,14 @@ basically retrieve all the Ether in the contract. In particular, the following contract will allow an attacker to refund multiple times as it uses ``call`` which forwards all remaining gas by default: -:: +.. code-block:: solidity - pragma solidity >=0.4.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.2 <0.9.0; // THIS CONTRACT CONTAINS A BUG - DO NOT USE contract Fund { - /// Mapping of ether shares of the contract. + /// @dev Mapping of ether shares of the contract. mapping(address => uint) shares; /// Withdraw your share. function withdraw() public { @@ -96,23 +98,31 @@ as it uses ``call`` which forwards all remaining gas by default: } To avoid re-entrancy, you can use the Checks-Effects-Interactions pattern as -outlined further below: +demonstrated below: -:: +.. code-block:: solidity - pragma solidity >=0.4.11 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.0 <0.9.0; contract Fund { - /// Mapping of ether shares of the contract. + /// @dev Mapping of ether shares of the contract. mapping(address => uint) shares; /// Withdraw your share. function withdraw() public { uint share = shares[msg.sender]; shares[msg.sender] = 0; - msg.sender.transfer(share); + payable(msg.sender).transfer(share); } } +The Checks-Effects-Interactions pattern ensures that all code paths through a contract complete all required checks +of the supplied parameters before modifying the contract's state (Checks); only then it makes any changes to the state (Effects); +it may make calls to functions in other contracts *after* all planned state changes have been written to +storage (Interactions). This is a common foolproof way to prevent *re-entrancy attacks*, where an externally called +malicious contract is able to double-spend an allowance, double-withdraw a balance, among other things, by using logic that calls back into the +original contract before it has finalized its transaction. + Note that re-entrancy is not only an effect of Ether transfer but of any function call on another contract. Furthermore, you also have to take multi-contract situations into account. A called contract could modify the @@ -178,36 +188,70 @@ Sending and Receiving Ether contract. Again, the best practice here is to use a :ref:`"withdraw" pattern instead of a "send" pattern `. -Callstack Depth -=============== +Call Stack Depth +================ External function calls can fail any time because they exceed the maximum -call stack of 1024. In such situations, Solidity throws an exception. +call stack size limit of 1024. In such situations, Solidity throws an exception. Malicious actors might be able to force the call stack to a high value -before they interact with your contract. +before they interact with your contract. Note that, since `Tangerine Whistle `_ hardfork, the `63/64 rule `_ makes call stack depth attack impractical. Also note that the call stack and the expression stack are unrelated, even though both have a size limit of 1024 stack slots. Note that ``.send()`` does **not** throw an exception if the call stack is depleted but rather returns ``false`` in that case. The low-level functions ``.call()``, ``.delegatecall()`` and ``.staticcall()`` behave in the same way. +Authorized Proxies +================== + +If your contract can act as a proxy, i.e. if it can call arbitrary contracts +with user-supplied data, then the user can essentially assume the identity +of the proxy contract. Even if you have other protective measures in place, +it is best to build your contract system such that the proxy does not have +any permissions (not even for itself). If needed, you can accomplish that +using a second proxy: + +.. code-block:: solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity ^0.8.0; + contract ProxyWithMoreFunctionality { + PermissionlessProxy proxy; + + function callOther(address addr, bytes memory payload) public + returns (bool, bytes memory) { + return proxy.callOther(addr, payload); + } + // Other functions and other functionality + } + + // This is the full contract, it has no other functionality and + // requires no privileges to work. + contract PermissionlessProxy { + function callOther(address addr, bytes memory payload) public + returns (bool, bytes memory) { + return addr.call(payload); + } + } + tx.origin ========= Never use tx.origin for authorization. Let's say you have a wallet contract like this: -:: - - pragma solidity >=0.5.0 <0.7.0; +.. code-block:: solidity + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; // THIS CONTRACT CONTAINS A BUG - DO NOT USE contract TxUserWallet { address owner; - constructor() public { + constructor() { owner = msg.sender; } function transferTo(address payable dest, uint amount) public { + // THE BUG IS RIGHT HERE, you must use msg.sender instead of tx.origin require(tx.origin == owner); dest.transfer(amount); } @@ -215,10 +259,10 @@ Never use tx.origin for authorization. Let's say you have a wallet contract like Now someone tricks you into sending Ether to the address of this attack wallet: -:: - - pragma solidity ^0.6.0; +.. code-block:: solidity + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; interface TxUserWallet { function transferTo(address payable dest, uint amount) external; } @@ -226,8 +270,8 @@ Now someone tricks you into sending Ether to the address of this attack wallet: contract TxAttackWallet { address payable owner; - constructor() public { - owner = msg.sender; + constructor() { + owner = payable(msg.sender); } receive() external payable { @@ -243,21 +287,32 @@ Two's Complement / Underflows / Overflows ========================================= As in many programming languages, Solidity's integer types are not actually integers. -They resemble integers when the values are small, but behave differently if the numbers are larger. -For example, the following is true: ``uint8(255) + uint8(1) == 0``. This situation is called -an *overflow*. It occurs when an operation is performed that requires a fixed size variable -to store a number (or piece of data) that is outside the range of the variable's data type. -An *underflow* is the converse situation: ``uint8(0) - uint8(1) == 255``. +They resemble integers when the values are small, but cannot represent arbitrarily large numbers. + +The following code causes an overflow because the result of the addition is too large +to be stored in the type ``uint8``: + +.. code-block:: solidity + + uint8 x = 255; + uint8 y = 1; + return x + y; + +Solidity has two modes in which it deals with these overflows: Checked and Unchecked or "wrapping" mode. + +The default checked mode will detect overflows and cause a failing assertion. You can disable this check +using ``unchecked { ... }``, causing the overflow to be silently ignored. The above code would return +``0`` if wrapped in ``unchecked { ... }``. + +Even in checked mode, do not assume you are protected from overflow bugs. +In this mode, overflows will always revert. If it is not possible to avoid the +overflow, this can lead to a smart contract being stuck in a certain state. In general, read about the limits of two's complement representation, which even has some more special edge cases for signed numbers. Try to use ``require`` to limit the size of inputs to a reasonable range and use the -:ref:`SMT checker` to find potential overflows, or use a library like -`SafeMath `_ -if you want all overflows to cause a revert. - -Code such as ``require((balanceOf[_to] + _value) >= balanceOf[_to])`` can also help you check if values are what you expect. +:ref:`SMT checker` to find potential overflows. .. _clearing-mappings: @@ -275,24 +330,25 @@ field of a ``struct`` that is the base type of a dynamic storage array. The ``mapping`` is also ignored in assignments of structs or arrays containing a ``mapping``. -:: +.. code-block:: solidity - pragma solidity >=0.5.0 <0.7.0; + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.6.0 <0.9.0; contract Map { mapping (uint => uint)[] array; - function allocate(uint _newMaps) public { - for (uint i = 0; i < _newMaps; i++) + function allocate(uint newMaps) public { + for (uint i = 0; i < newMaps; i++) array.push(); } - function writeMap(uint _map, uint _key, uint _value) public { - array[_map][_key] = _value; + function writeMap(uint map, uint key, uint value) public { + array[map][key] = value; } - function readMap(uint _map, uint _key) public view returns (uint) { - return array[_map][_key]; + function readMap(uint map, uint key) public view returns (uint) { + return array[map][key]; } function eraseMaps() public { @@ -331,7 +387,7 @@ Recommendations Take Warnings Seriously ======================= -If the compiler warns you about something, you should better change it. +If the compiler warns you about something, you should change it. Even if you do not think that this particular warning has security implications, there might be another issue buried beneath it. Any compiler warning we issue can be silenced by slight changes to the @@ -340,6 +396,10 @@ code. Always use the latest version of the compiler to be notified about all recently introduced warnings. +Messages of type ``info`` issued by the compiler are not dangerous, and simply +represent extra suggestions and optional information that the compiler thinks +might be useful to the user. + Restrict the Amount of Ether ============================ @@ -398,242 +458,3 @@ Ask for Peer Review The more people examine a piece of code, the more issues are found. Asking people to review your code also helps as a cross-check to find out whether your code is easy to understand - a very important criterion for good smart contracts. - -.. _formal_verification: - -******************* -Formal Verification -******************* - -Using formal verification, it is possible to perform an automated mathematical -proof that your source code fulfills a certain formal specification. -The specification is still formal (just as the source code), but usually much -simpler. - -Note that formal verification itself can only help you understand the -difference between what you did (the specification) and how you did it -(the actual implementation). You still need to check whether the specification -is what you wanted and that you did not miss any unintended effects of it. - -Solidity implements a formal verification approach based on SMT solving. The -SMTChecker module automatically tries to prove that the code satisfies the -specification given by ``require/assert`` statements. That is, it considers -``require`` statements as assumptions and tries to prove that the conditions -inside ``assert`` statements are always true. If an assertion failure is -found, a counterexample is given to the user, showing how the assertion can be -violated. - -The SMTChecker also checks automatically for arithmetic underflow/overflow, -trivial conditions and unreachable code. -It is currently an experimental feature, therefore in order to use it you need -to enable it via :ref:`a pragma directive`. - -The SMTChecker traverses the Solidity AST creating and collecting program constraints. -When it encounters a verification target, an SMT solver is invoked to determine the outcome. -If a check fails, the SMTChecker provides specific input values that lead to the failure. - -While the SMTChecker encodes Solidity code into SMT constraints, it contains two -reasoning engines that use that encoding in different ways. - -SMT Encoding -============ - -The SMT encoding tries to be as precise as possible, mapping Solidity types -and expressions to their closest `SMT-LIB `_ -representation, as shown in the table below. - -+-----------------------+--------------+-----------------------------+ -|Solidity type |SMT sort |Theories (quantifier-free) | -+=======================+==============+=============================+ -|Boolean |Bool |Bool | -+-----------------------+--------------+-----------------------------+ -|intN, uintN, address, |Integer |LIA, NIA | -|bytesN, enum | | | -+-----------------------+--------------+-----------------------------+ -|array, mapping, bytes, |Array |Arrays | -|string | | | -+-----------------------+--------------+-----------------------------+ -|other types |Integer |LIA | -+-----------------------+--------------+-----------------------------+ - -Types that are not yet supported are abstracted by a single 256-bit unsigned -integer, where their unsupported operations are ignored. - -For more details on how the SMT encoding works internally, see the paper -`SMT-based Verification of Solidity Smart Contracts `_. - -Model Checking Engines -====================== - -The SMTChecker module implements two different reasoning engines that use the -SMT encoding above, a Bounded Model Checker (BMC) and a system of Constrained -Horn Clauses (CHC). Both engines are currently under development, and have -different characteristics. - -Bounded Model Checker (BMC) ---------------------------- - -The BMC engine analyzes functions in isolation, that is, it does not take the -overall behavior of the contract throughout many transactions into account when -analyzing each function. Loops are also ignored in this engine at the moment. -Internal function calls are inlined as long as they are not recursive, direct -or indirectly. External function calls are inlined if possible, and knowledge -that is potentially affected by reentrancy is erased. - -The characteristics above make BMC easily prone to reporting false positives, -but it is also lightweight and should be able to quickly find small local bugs. - -Constrained Horn Clauses (CHC) ------------------------------- - -The Solidity contract's Control Flow Graph (CFG) is modelled as a system of -Horn clauses, where the lifecycle of the contract is represented by a loop -that can visit every public/external function non-deterministically. This way, -the behavior of the entire contract over an unbounded number of transactions -is taken into account when analyzing any function. Loops are fully supported -by this engine. Function calls are currently unsupported. - -The CHC engine is much more powerful than BMC in terms of what it can prove, -and might require more computing resources. - -Abstraction and False Positives -=============================== - -The SMTChecker implements abstractions in an incomplete and sound way: If a bug -is reported, it might be a false positive introduced by abstractions (due to -erasing knowledge or using a non-precise type). If it determines that a -verification target is safe, it is indeed safe, that is, there are no false -negatives (unless there is a bug in the SMTChecker). - -Function calls to the same contract (or base contracts) are inlined when -possible, that is, when their implementation is available. -Calls to functions in other contracts are not inlined even if their code is -available, since we cannot guarantee that the actual deployed code is the same. -Complex pure functions are abstracted by an uninterpreted function (UF) over -the arguments. - -+-----------------------------------+--------------------------------------+ -|Functions |SMT behavior | -+===================================+======================================+ -|``assert`` |Verification target | -+-----------------------------------+--------------------------------------+ -|``require`` |Assumption | -+-----------------------------------+--------------------------------------+ -|internal |Inline function call | -+-----------------------------------+--------------------------------------+ -|external |Inline function call | -| |Erase knowledge about state variables | -| |and local storage references | -+-----------------------------------+--------------------------------------+ -|``gasleft``, ``blockhash``, |Abstracted with UF | -|``keccak256``, ``ecrecover`` | | -|``ripemd160``, ``addmod``, | | -|``mulmod`` | | -+-----------------------------------+--------------------------------------+ -|pure functions without |Abstracted with UF | -|implementation (external or | | -|complex) | | -+-----------------------------------+--------------------------------------+ -|external functions without |Unsupported | -|implementation | | -+-----------------------------------+--------------------------------------+ -|others |Currently unsupported | -+-----------------------------------+--------------------------------------+ - -Using abstraction means loss of precise knowledge, but in many cases it does -not mean loss of proving power. - -:: - - pragma solidity >=0.5.0; - pragma experimental SMTChecker; - - contract Recover - { - function f( - bytes32 hash, - uint8 _v1, uint8 _v2, - bytes32 _r1, bytes32 _r2, - bytes32 _s1, bytes32 _s2 - ) public pure returns (address) { - address a1 = ecrecover(hash, _v1, _r1, _s1); - require(_v1 == _v2); - require(_r1 == _r2); - require(_s1 == _s2); - address a2 = ecrecover(hash, _v2, _r2, _s2); - assert(a1 == a2); - return a1; - } - } - -In the example above, the SMTChecker is not expressive enough to actually -compute ``ecrecover``, but by modelling the function calls as uninterpreted -functions we know that the return value is the same when called on equivalent -parameters. This is enough to prove that the assertion above is always true. - -Abstracting a function call with an UF can be done for functions known to be -deterministic, and can be easily done for pure functions. It is however -difficult to do this with general external functions, since they might depend -on state variables. - -External function calls also imply that any current knowledge that the -SMTChecker might have regarding mutable state variables needs to be erased to -guarantee no false negatives, since the called external function might direct -or indirectly call a function in the analyzed contract that changes state -variables. - -Reference Types and Aliasing -============================= - -Solidity implements aliasing for reference types with the same :ref:`data -location`. -That means one variable may be modified through a reference to the same data -area. -The SMTChecker does not keep track of which references refer to the same data. -This implies that whenever a local reference or state variable of reference -type is assigned, all knowledge regarding variables of the same type and data -location is erased. -If the type is nested, the knowledge removal also includes all the prefix base -types. - -:: - - pragma solidity >=0.5.0; - pragma experimental SMTChecker; - // This will report a warning - contract Aliasing - { - uint[] array; - function f( - uint[] memory a, - uint[] memory b, - uint[][] memory c, - uint[] storage d - ) internal view { - require(array[0] == 42); - require(a[0] == 2); - require(c[0][0] == 2); - require(d[0] == 2); - b[0] = 1; - // Erasing knowledge about memory references should not - // erase knowledge about state variables. - assert(array[0] == 42); - // Fails because `a == b` is possible. - assert(a[0] == 2); - // Fails because `c[i] == b` is possible. - assert(c[0][0] == 2); - assert(d[0] == 2); - assert(b[0] == 1); - } - } - -After the assignment to ``b[0]``, we need to clear knowledge about ``a`` since -it has the same type (``uint[]``) and data location (memory). We also need to -clear knowledge about ``c``, since its base type is also a ``uint[]`` located -in memory. This implies that some ``c[i]`` could refer to the same data as -``b`` or ``a``. - -Notice that we do not clear knowledge about ``array`` and ``d`` because they -are located in storage, even though they also have type ``uint[]``. However, -if ``d`` was assigned, we would need to clear knowledge about ``array`` and -vice-versa. diff --git a/compiler/docs/smtchecker.rst b/compiler/docs/smtchecker.rst new file mode 100644 index 00000000..6d2f4373 --- /dev/null +++ b/compiler/docs/smtchecker.rst @@ -0,0 +1,888 @@ +.. _formal_verification: + +################################## +SMTChecker and Formal Verification +################################## + +Using formal verification it is possible to perform an automated mathematical +proof that your source code fulfills a certain formal specification. +The specification is still formal (just as the source code), but usually much +simpler. + +Note that formal verification itself can only help you understand the +difference between what you did (the specification) and how you did it +(the actual implementation). You still need to check whether the specification +is what you wanted and that you did not miss any unintended effects of it. + +Solidity implements a formal verification approach based on +`SMT (Satisfiability Modulo Theories) `_ and +`Horn `_ solving. +The SMTChecker module automatically tries to prove that the code satisfies the +specification given by ``require`` and ``assert`` statements. That is, it considers +``require`` statements as assumptions and tries to prove that the conditions +inside ``assert`` statements are always true. If an assertion failure is +found, a counterexample may be given to the user showing how the assertion can +be violated. If no warning is given by the SMTChecker for a property, +it means that the property is safe. + +The other verification targets that the SMTChecker checks at compile time are: + +- Arithmetic underflow and overflow. +- Division by zero. +- Trivial conditions and unreachable code. +- Popping an empty array. +- Out of bounds index access. +- Insufficient funds for a transfer. + +All the targets above are automatically checked by default if all engines are +enabled, except underflow and overflow for Solidity >=0.8.7. + +The potential warnings that the SMTChecker reports are: + +- `` happens here.``. This means that the SMTChecker proved that a certain property fails. A counterexample may be given, however in complex situations it may also not show a counterexample. This result may also be a false positive in certain cases, when the SMT encoding adds abstractions for Solidity code that is either hard or impossible to express. +- `` might happen here``. This means that the solver could not prove either case within the given timeout. Since the result is unknown, the SMTChecker reports the potential failure for soundness. This may be solved by increasing the query timeout, but the problem might also simply be too hard for the engine to solve. + +To enable the SMTChecker, you must select :ref:`which engine should run`, +where the default is no engine. Selecting the engine enables the SMTChecker on all files. + +.. note:: + + Prior to Solidity 0.8.4, the default way to enable the SMTChecker was via + ``pragma experimental SMTChecker;`` and only the contracts containing the + pragma would be analyzed. That pragma has been deprecated, and although it + still enables the SMTChecker for backwards compatibility, it will be removed + in Solidity 0.9.0. Note also that now using the pragma even in a single file + enables the SMTChecker for all files. + +.. note:: + + The lack of warnings for a verification target represents an undisputed + mathematical proof of correctness, assuming no bugs in the SMTChecker and + the underlying solver. Keep in mind that these problems are + *very hard* and sometimes *impossible* to solve automatically in the + general case. Therefore, several properties might not be solved or might + lead to false positives for large contracts. Every proven property should + be seen as an important achievement. For advanced users, see :ref:`SMTChecker Tuning ` + to learn a few options that might help proving more complex + properties. + +******** +Tutorial +******** + +Overflow +======== + +.. code-block:: Solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.8.0; + + contract Overflow { + uint immutable x; + uint immutable y; + + function add(uint x_, uint y_) internal pure returns (uint) { + return x_ + y_; + } + + constructor(uint x_, uint y_) { + (x, y) = (x_, y_); + } + + function stateAdd() public view returns (uint) { + return add(x, y); + } + } + +The contract above shows an overflow check example. +The SMTChecker does not check underflow and overflow by default for Solidity >=0.8.7, +so we need to use the command line option ``--model-checker-targets "underflow,overflow"`` +or the JSON option ``settings.modelChecker.targets = ["underflow", "overflow"]``. +See :ref:`this section for targets configuration`. +Here, it reports the following: + +.. code-block:: text + + Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here. + Counterexample: + x = 1, y = 115792089237316195423570985008687907853269984665640564039457584007913129639935 + = 0 + + Transaction trace: + Overflow.constructor(1, 115792089237316195423570985008687907853269984665640564039457584007913129639935) + State: x = 1, y = 115792089237316195423570985008687907853269984665640564039457584007913129639935 + Overflow.stateAdd() + Overflow.add(1, 115792089237316195423570985008687907853269984665640564039457584007913129639935) -- internal call + --> o.sol:9:20: + | + 9 | return x_ + y_; + | ^^^^^^^ + +If we add ``require`` statements that filter out overflow cases, +the SMTChecker proves that no overflow is reachable (by not reporting warnings): + +.. code-block:: Solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.8.0; + + contract Overflow { + uint immutable x; + uint immutable y; + + function add(uint x_, uint y_) internal pure returns (uint) { + return x_ + y_; + } + + constructor(uint x_, uint y_) { + (x, y) = (x_, y_); + } + + function stateAdd() public view returns (uint) { + require(x < type(uint128).max); + require(y < type(uint128).max); + return add(x, y); + } + } + + +Assert +====== + +An assertion represents an invariant in your code: a property that must be true +*for all transactions, including all input and storage values*, otherwise there is a bug. + +The code below defines a function ``f`` that guarantees no overflow. +Function ``inv`` defines the specification that ``f`` is monotonically increasing: +for every possible pair ``(a, b)``, if ``b > a`` then ``f(b) > f(a)``. +Since ``f`` is indeed monotonically increasing, the SMTChecker proves that our +property is correct. You are encouraged to play with the property and the function +definition to see what results come out! + +.. code-block:: Solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.8.0; + + contract Monotonic { + function f(uint x) internal pure returns (uint) { + require(x < type(uint128).max); + return x * 42; + } + + function inv(uint a, uint b) public pure { + require(b > a); + assert(f(b) > f(a)); + } + } + +We can also add assertions inside loops to verify more complicated properties. +The following code searches for the maximum element of an unrestricted array of +numbers, and asserts the property that the found element must be greater or +equal every element in the array. + +.. code-block:: Solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.8.0; + + contract Max { + function max(uint[] memory a) public pure returns (uint) { + uint m = 0; + for (uint i = 0; i < a.length; ++i) + if (a[i] > m) + m = a[i]; + + for (uint i = 0; i < a.length; ++i) + assert(m >= a[i]); + + return m; + } + } + +Note that in this example the SMTChecker will automatically try to prove three properties: + +1. ``++i`` in the first loop does not overflow. +2. ``++i`` in the second loop does not overflow. +3. The assertion is always true. + +.. note:: + + The properties involve loops, which makes it *much much* harder than the previous + examples, so beware of loops! + +All the properties are correctly proven safe. Feel free to change the +properties and/or add restrictions on the array to see different results. +For example, changing the code to + +.. code-block:: Solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.8.0; + + contract Max { + function max(uint[] memory a) public pure returns (uint) { + require(a.length >= 5); + uint m = 0; + for (uint i = 0; i < a.length; ++i) + if (a[i] > m) + m = a[i]; + + for (uint i = 0; i < a.length; ++i) + assert(m > a[i]); + + return m; + } + } + +gives us: + +.. code-block:: text + + Warning: CHC: Assertion violation happens here. + Counterexample: + + a = [0, 0, 0, 0, 0] + = 0 + + Transaction trace: + Test.constructor() + Test.max([0, 0, 0, 0, 0]) + --> max.sol:14:4: + | + 14 | assert(m > a[i]); + + +State Properties +================ + +So far the examples only demonstrated the use of the SMTChecker over pure code, +proving properties about specific operations or algorithms. +A common type of properties in smart contracts are properties that involve the +state of the contract. Multiple transactions might be needed to make an assertion +fail for such a property. + +As an example, consider a 2D grid where both axis have coordinates in the range (-2^128, 2^128 - 1). +Let us place a robot at position (0, 0). The robot can only move diagonally, one step at a time, +and cannot move outside the grid. The robot's state machine can be represented by the smart contract +below. + +.. code-block:: Solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.8.0; + + contract Robot { + int x = 0; + int y = 0; + + modifier wall { + require(x > type(int128).min && x < type(int128).max); + require(y > type(int128).min && y < type(int128).max); + _; + } + + function moveLeftUp() wall public { + --x; + ++y; + } + + function moveLeftDown() wall public { + --x; + --y; + } + + function moveRightUp() wall public { + ++x; + ++y; + } + + function moveRightDown() wall public { + ++x; + --y; + } + + function inv() public view { + assert((x + y) % 2 == 0); + } + } + +Function ``inv`` represents an invariant of the state machine that ``x + y`` +must be even. +The SMTChecker manages to prove that regardless how many commands we give the +robot, even if infinitely many, the invariant can *never* fail. The interested +reader may want to prove that fact manually as well. Hint: this invariant is +inductive. + +We can also trick the SMTChecker into giving us a path to a certain position we +think might be reachable. We can add the property that (2, 4) is *not* +reachable, by adding the following function. + +.. code-block:: Solidity + + function reach_2_4() public view { + assert(!(x == 2 && y == 4)); + } + +This property is false, and while proving that the property is false, +the SMTChecker tells us exactly *how* to reach (2, 4): + +.. code-block:: text + + Warning: CHC: Assertion violation happens here. + Counterexample: + x = 2, y = 4 + + Transaction trace: + Robot.constructor() + State: x = 0, y = 0 + Robot.moveLeftUp() + State: x = (- 1), y = 1 + Robot.moveRightUp() + State: x = 0, y = 2 + Robot.moveRightUp() + State: x = 1, y = 3 + Robot.moveRightUp() + State: x = 2, y = 4 + Robot.reach_2_4() + --> r.sol:35:4: + | + 35 | assert(!(x == 2 && y == 4)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Note that the path above is not necessarily deterministic, as there are +other paths that could reach (2, 4). The choice of which path is shown +might change depending on the used solver, its version, or just randomly. + +External Calls and Reentrancy +============================= + +Every external call is treated as a call to unknown code by the SMTChecker. +The reasoning behind that is that even if the code of the called contract is +available at compile time, there is no guarantee that the deployed contract +will indeed be the same as the contract where the interface came from at +compile time. + +In some cases, it is possible to automatically infer properties over state +variables that are still true even if the externally called code can do +anything, including reenter the caller contract. + +.. code-block:: Solidity + + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.8.0; + + interface Unknown { + function run() external; + } + + contract Mutex { + uint x; + bool lock; + + Unknown immutable unknown; + + constructor(Unknown u) { + require(address(u) != address(0)); + unknown = u; + } + + modifier mutex { + require(!lock); + lock = true; + _; + lock = false; + } + + function set(uint x_) mutex public { + x = x_; + } + + function run() mutex public { + uint xPre = x; + unknown.run(); + assert(xPre == x); + } + } + +The example above shows a contract that uses a mutex flag to forbid reentrancy. +The solver is able to infer that when ``unknown.run()`` is called, the contract +is already "locked", so it would not be possible to change the value of ``x``, +regardless of what the unknown called code does. + +If we "forget" to use the ``mutex`` modifier on function ``set``, the +SMTChecker is able to synthesize the behaviour of the externally called code so +that the assertion fails: + +.. code-block:: text + + Warning: CHC: Assertion violation happens here. + Counterexample: + x = 1, lock = true, unknown = 1 + + Transaction trace: + Mutex.constructor(1) + State: x = 0, lock = false, unknown = 1 + Mutex.run() + unknown.run() -- untrusted external call, synthesized as: + Mutex.set(1) -- reentrant call + --> m.sol:32:3: + | + 32 | assert(xPre == x); + | ^^^^^^^^^^^^^^^^^ + + +.. _smtchecker_options: + +***************************** +SMTChecker Options and Tuning +***************************** + +Timeout +======= + +The SMTChecker uses a hardcoded resource limit (``rlimit``) chosen per solver, +which is not precisely related to time. We chose the ``rlimit`` option as the default +because it gives more determinism guarantees than time inside the solver. + +This options translates roughly to "a few seconds timeout" per query. Of course many properties +are very complex and need a lot of time to be solved, where determinism does not matter. +If the SMTChecker does not manage to solve the contract properties with the default ``rlimit``, +a timeout can be given in milliseconds via the CLI option ``--model-checker-timeout