Skip to content

Commit f956cc8

Browse files
authored
Merge pull request #8616 from ethereum/develop
Merge develop into release for 0.6.5
2 parents 1dca32f + 3f52ee4 commit f956cc8

File tree

1,144 files changed

+23899
-13987
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,144 files changed

+23899
-13987
lines changed

.circleci/config.yml

+27
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ defaults:
122122
name: command line tests
123123
command: ./test/cmdlineTests.sh
124124

125+
- run_docs_pragma_min_version: &run_docs_pragma_min_version
126+
name: docs pragma version check
127+
command: ./scripts/docs_version_pragma_check.sh
128+
125129
- test_ubuntu1604_clang: &test_ubuntu1604_clang
126130
docker:
127131
- image: ethereum/solidity-buildpack-deps:ubuntu1604-clang-ossfuzz-<< pipeline.parameters.ubuntu-1604-clang-ossfuzz-docker-image-rev >>
@@ -303,6 +307,18 @@ jobs:
303307
name: Linting Python Scripts
304308
command: ./scripts/pylint_all.py
305309

310+
chk_antlr_grammar:
311+
docker:
312+
- image: buildpack-deps:eoan
313+
steps:
314+
- checkout
315+
- run:
316+
name: Install Java
317+
command: apt -q update && apt install -y openjdk-14-jdk
318+
- run:
319+
name: Run tests
320+
command: ./scripts/test_antlr_grammar.sh
321+
306322
chk_buglist:
307323
docker:
308324
- image: circleci/node
@@ -335,6 +351,15 @@ jobs:
335351
pip install --user z3-solver
336352
- run: *run_proofs
337353

354+
chk_docs_pragma_min_version:
355+
docker:
356+
- image: ethereum/solidity-buildpack-deps:ubuntu1904-<< pipeline.parameters.ubuntu-1904-docker-image-rev >>
357+
environment:
358+
TERM: xterm
359+
steps:
360+
- checkout
361+
- run: *run_docs_pragma_min_version
362+
338363
b_ubu_clang: &build_ubuntu1904_clang
339364
docker:
340365
- image: ethereum/solidity-buildpack-deps:ubuntu1904-clang-<< pipeline.parameters.ubuntu-1904-clang-docker-image-rev >>
@@ -768,6 +793,8 @@ workflows:
768793
- chk_buglist: *workflow_trigger_on_tags
769794
- chk_proofs: *workflow_trigger_on_tags
770795
- chk_pylint: *workflow_trigger_on_tags
796+
- chk_antlr_grammar: *workflow_trigger_on_tags
797+
- chk_docs_pragma_min_version: *workflow_trigger_on_tags
771798

772799
# build-only
773800
- b_docs: *workflow_trigger_on_tags

.clang-format

+11-2
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,35 @@
66
# Note that clang-format cannot express the style that closing parentheses
77
# behave similar to closing curly braces in a multi-line setting in that
88
# they have to be on a line of their own at the same indentation level
9-
# as the opening part.
9+
# as the opening part (aka "dangling parenthesis", see https://reviews.llvm.org/D33029).
1010

1111
Language: Cpp
1212
BasedOnStyle: LLVM
13+
AccessModifierOffset: -4
14+
AlignAfterOpenBracket: AlwaysBreak
1315
AlignEscapedNewlinesLeft: true
1416
AlwaysBreakAfterReturnType: None
17+
AlwaysBreakTemplateDeclarations: Yes
1518
BinPackArguments: false
1619
BinPackParameters: false
1720
BreakBeforeBinaryOperators: All
1821
BreakBeforeBraces: Allman
1922
ColumnLimit: 120
2023
ContinuationIndentWidth: 4
24+
FixNamespaceComments: false
2125
IndentWidth: 4
2226
KeepEmptyLinesAtTheStartOfBlocks: false
2327
MaxEmptyLinesToKeep: 2
2428
PenaltyBreakBeforeFirstCallParameter: 2000
29+
PointerAlignment: Left
2530
SpaceAfterCStyleCast: true
31+
SpaceAfterTemplateKeyword: false
32+
SpaceBeforeCtorInitializerColon: false
33+
SpaceBeforeInheritanceColon: false
2634
SpaceBeforeParens: ControlStatements
35+
SpaceBeforeRangeBasedForLoopColon: false
2736
TabWidth: 4
28-
UseTab: ForIndentation
37+
UseTab: Always
2938

3039
# Local Variables:
3140
# mode: yaml

.github/ISSUE_TEMPLATE/general.md

-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +0,0 @@
1-
---
2-
name: General Feedback
3-
about: Any general feedback (neither feature request nor bug reports)
4-
---
5-
6-
<!--## Prerequisites
7-
8-
- First, many thanks for taking part in the community. We really appreciate that.
9-
- Read the [contributing guidelines](http://solidity.readthedocs.io/en/latest/contributing.html).
10-
- Support questions are better asked in one of the following locations:
11-
- [Solidity chat](https://gitter.im/ethereum/solidity)
12-
- [Stack Overflow](https://ethereum.stackexchange.com/)
13-
- Ensure the issue isn't already reported.
14-
15-
*Delete the above section and the instructions in the sections below before submitting*
16-
-->
17-
## Description
18-
19-
<!--
20-
Please describe the purpose of your ticket.
21-
-->

.github/PULL_REQUEST_TEMPLATE.md

-22
This file was deleted.

CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ include(EthPolicy)
1010
eth_policy()
1111

1212
# project name and version should be set after cmake_policy CMP0048
13-
set(PROJECT_VERSION "0.6.4")
13+
set(PROJECT_VERSION "0.6.5")
14+
# OSX target needed in order to support std::visit
15+
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
1416
project(solidity VERSION ${PROJECT_VERSION} LANGUAGES C CXX)
1517

1618
include(TestBigEndian)

CODING_STYLE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ struct MeanSigma
141141
double const d = 0;
142142
int i = 0;
143143
int j = 0;
144-
char* s;
144+
char* s = nullptr;
145145
MeanAndSigma ms meanAndSigma(std::vector<float> const& _v, Accuracy _a);
146146
Derived* x = dynamic_cast<Derived*>(base);
147147
for (auto i = x->begin(); i != x->end(); ++i) {}

Changelog.md

+32-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
### 0.6.5 (2020-04-06)
2+
3+
Important Bugfixes:
4+
* Code Generator: Restrict the length of dynamic memory arrays to 64 bits during creation at runtime fixing a possible overflow.
5+
6+
7+
Language Features:
8+
* Allow local storage variables to be declared without initialization, as long as they are assigned before they are accessed.
9+
* 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.
10+
11+
12+
Compiler Features:
13+
* Commandline Interface: Enable output of storage layout with `--storage-layout`.
14+
* Metadata: Added support for IPFS hashes of large files that need to be split in multiple chunks.
15+
16+
17+
Bugfixes:
18+
* Inheritance: Allow public state variables to override functions with dynamic memory types in their return values.
19+
* Inline Assembly: Fix internal error when accessing invalid constant variables.
20+
* Inline Assembly: Fix internal error when accessing functions.
21+
* JSON AST: Always add pointer suffix for memory reference types.
22+
* Reference Resolver: Fix internal error when accessing invalid struct members.
23+
* Type Checker: Fix internal errors when assigning nested tuples.
24+
25+
126
### 0.6.4 (2020-03-10)
227

328
Language Features:
@@ -18,7 +43,6 @@ Bugfixes:
1843
* SMTChecker: Fix internal errors when analysing tuples.
1944
* Yul AST Import: correctly import blocks as statements, switch statements and string literals.
2045

21-
2246
### 0.6.3 (2020-02-18)
2347

2448
Language Features:
@@ -32,6 +56,7 @@ Compiler Features:
3256
* Code Generator: Use ``calldatacopy`` instead of ``codecopy`` to zero out memory past input.
3357
* Debug: Provide reason strings for compiler-generated internal reverts when using the ``--revert-strings`` option or the ``settings.debug.revertStrings`` setting on ``debug`` mode.
3458
* Yul Optimizer: Prune functions that call each other but are otherwise unreferenced.
59+
* SMTChecker: CHC support to internal function calls.
3560

3661

3762
Bugfixes:
@@ -120,6 +145,12 @@ Compiler Features:
120145
* ABIEncoderV2: Do not warn about enabled ABIEncoderV2 anymore (the pragma is still needed, though).
121146

122147

148+
### 0.5.17 (2020-03-17)
149+
150+
Bugfixes:
151+
* Type Checker: Disallow overriding of private functions.
152+
153+
123154
### 0.5.16 (2020-01-02)
124155

125156
Backported Bugfixes:

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Solidity is a statically typed, contract-oriented, high-level language for imple
1212
- [Development](#development)
1313
- [Maintainers](#maintainers)
1414
- [License](#license)
15+
- [Security](#security)
1516

1617
## Background
1718

@@ -75,3 +76,7 @@ releases [in the projects section](https://github.com/ethereum/solidity/projects
7576
Solidity is licensed under [GNU General Public License v3.0](LICENSE.txt).
7677

7778
Some third-party code has its [own licensing terms](cmake/templates/license.h.in).
79+
80+
## Security
81+
82+
The security policy may be [found here](SECURITY.md).

SECURITY.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Security Policy
2+
3+
The Solidity team and community take all security bugs in Solidity seriously.
4+
We appreciate your efforts and responsible disclosure and will make every effort to acknowledge your contributions.
5+
6+
## Scope
7+
8+
Bugs in the Solidity repository are in scope.
9+
Bugs in third-party dependencies e.g., jsoncpp, boost etc. are not in scope unless they result in a Solidity specific bug.
10+
11+
Only bugs that have a demonstrable security impact on smart contracts are in scope.
12+
For example, a Solidity program whose optimization is incorrect (e.g., leads to an incorrect output) qualifies as a security bug.
13+
Please note that the [rules][2] of the [Ethereum bounty program][1] have precedence over this security policy.
14+
15+
## Supported Versions
16+
17+
As a general rule, only the latest release gets security updates.
18+
Exceptions may be made when the current breaking release is relatively new, e.g. less than three months old.
19+
If you are reporting a bug, please state clearly the Solidity version(s) it affects.
20+
21+
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)`).
22+
23+
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`.
24+
25+
## Reporting a Vulnerability
26+
27+
To report a vulnerability, please follow the instructions stated in the [Ethereum bounty program][1].
28+
29+
In the bug report, please include all details necessary to reproduce the vulnerability such as:
30+
31+
- Input program that triggers the bug
32+
- Compiler version affected
33+
- Target EVM version
34+
- Framework/IDE if applicable
35+
- EVM execution environment/client if applicable
36+
- Operating system
37+
38+
Please include steps to reproduce the bug you have found in as much detail as possible.
39+
40+
Once we have received your bug report, we will try to reproduce it and provide a more detailed response.
41+
Once the reported bug has been successfully reproduced, the Solidity team will work on a fix.
42+
43+
The Solidity team maintains the following JSON-formatted lists of patched security vulnerabilities:
44+
45+
- [Summary of known security vulnerabilities][3]
46+
- [List of security vulnerabilities affecting a specific version of the compiler][4].
47+
48+
49+
[1]: https://bounty.ethereum.org/
50+
[2]: https://bounty.ethereum.org/#rules
51+
[3]: https://solidity.readthedocs.io/en/develop/bugs.html
52+
[4]: https://github.com/ethereum/solidity/blob/develop/docs/bugs_by_version.json

cmake/EthCompilerSettings.cmake

+11
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ eth_add_cxx_compiler_flag_if_supported(-Wimplicit-fallthrough)
2626
# Prevent the path of the source directory from ending up in the binary via __FILE__ macros.
2727
eth_add_cxx_compiler_flag_if_supported("-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=/solidity")
2828

29+
# -Wpessimizing-move warns when a call to std::move would prevent copy elision
30+
# if the argument was not wrapped in a call. This happens when moving a local
31+
# variable in a return statement when the variable is the same type as the
32+
# return type or using a move to create a new object from a temporary object.
33+
eth_add_cxx_compiler_flag_if_supported(-Wpessimizing-move)
34+
35+
# -Wredundant-move warns when an implicit move would already be made, so the
36+
# std::move call is not needed, such as when moving a local variable in a return
37+
# that is different from the return type.
38+
eth_add_cxx_compiler_flag_if_supported(-Wredundant-move)
39+
2940
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
3041
# Enables all the warnings about constructions that some users consider questionable,
3142
# and that are easy to avoid. Also enable some extra warning flags that are not

docs/050-breaking-changes.rst

+7-5
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,9 @@ Consider you have the following pre-0.5.0 contract already deployed:
292292

293293
::
294294

295-
// This will not compile with the current version of the compiler
296295
pragma solidity ^0.4.25;
296+
// This will report a warning until version 0.4.25 of the compiler
297+
// This will not compile after 0.5.0
297298
contract OldContract {
298299
function someOldFunction(uint8 a) {
299300
//...
@@ -369,8 +370,8 @@ Old version:
369370

370371
::
371372

372-
// This will not compile
373373
pragma solidity ^0.4.25;
374+
// This will not compile after 0.5.0
374375

375376
contract OtherContract {
376377
uint x;
@@ -396,7 +397,7 @@ Old version:
396397
// Throw is fine in this version.
397398
if (x > 100)
398399
throw;
399-
bytes b = new bytes(x);
400+
bytes memory b = new bytes(x);
400401
y = -3 >> 1;
401402
// y == -1 (wrong, should be -2)
402403
do {
@@ -431,14 +432,15 @@ New version:
431432

432433
::
433434

434-
pragma solidity >=0.5.0 <0.7.0;
435+
pragma solidity >=0.5.0 <0.5.99;
436+
// This will not compile after 0.6.0
435437

436438
contract OtherContract {
437439
uint x;
438440
function f(uint y) external {
439441
x = y;
440442
}
441-
receive() payable external {}
443+
function() payable external {}
442444
}
443445

444446
contract New {

0 commit comments

Comments
 (0)