Skip to content

Commit 8dda952

Browse files
authored
Merge pull request #8341 from ethereum/develop
Merge develop into release for 0.6.3
2 parents bacdbe5 + c2e22d4 commit 8dda952

File tree

435 files changed

+12385
-3208
lines changed

Some content is hidden

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

435 files changed

+12385
-3208
lines changed

.circleci/config.yml

+25-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ defaults:
6262
path: build/solc/solc
6363
destination: solc
6464

65+
# compiled tool executable target
66+
- artifacts_tools: &artifacts_tools
67+
path: build/tools/solidity-upgrade
68+
destination: solidity-upgrade
69+
6570
# compiled executable targets
6671
- artifacts_executables: &artifacts_executables
6772
root: build
@@ -257,6 +262,22 @@ jobs:
257262
name: Check for C++ coding style
258263
command: ./scripts/check_style.sh
259264

265+
chk_pylint:
266+
docker:
267+
- image: buildpack-deps:eoan
268+
steps:
269+
- checkout
270+
- run:
271+
name: Install pip
272+
command: apt -q update && apt install -y python3-pip
273+
- run:
274+
name: Install pylint
275+
command: python3 -m pip install pylint z3-solver pygments-lexer-solidity
276+
# also z3-solver to make sure pylint knows about this module, pygments-lexer-solidity for docs
277+
- run:
278+
name: Linting Python Scripts
279+
command: ./scripts/pylint_all.py
280+
260281
chk_buglist:
261282
docker:
262283
- image: circleci/node
@@ -308,6 +329,7 @@ jobs:
308329
- checkout
309330
- run: *run_build
310331
- store_artifacts: *artifacts_solc
332+
- store_artifacts: *artifacts_tools
311333
- persist_to_workspace: *artifacts_executables
312334

313335
b_ubu_release: &build_ubuntu1904_release
@@ -391,8 +413,8 @@ jobs:
391413
- run:
392414
name: Regression tests
393415
command: |
416+
git clone https://github.com/ethereum/solidity-fuzzing-corpus /tmp/solidity-fuzzing-corpus
394417
mkdir -p test_results
395-
export ASAN_OPTIONS="check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2"
396418
scripts/regressions.py -o test_results
397419
- run: *gitter_notify_failure
398420
- run: *gitter_notify_success
@@ -439,6 +461,7 @@ jobs:
439461
- /usr/local/Homebrew
440462
- run: *run_build
441463
- store_artifacts: *artifacts_solc
464+
- store_artifacts: *artifacts_tools
442465
- persist_to_workspace: *artifacts_build_dir
443466

444467
t_osx_soltest:
@@ -718,6 +741,7 @@ workflows:
718741
# DISABLED FOR 0.6.0 - chk_docs_examples: *workflow_trigger_on_tags
719742
- chk_buglist: *workflow_trigger_on_tags
720743
- chk_proofs: *workflow_trigger_on_tags
744+
- chk_pylint: *workflow_trigger_on_tags
721745

722746
# build-only
723747
- b_docs: *workflow_trigger_on_tags

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ docs/utils/*.pyc
4040
/deps/downloads/
4141
deps/install
4242
deps/cache
43+
cmake-build-debug/
4344

4445
# vim stuff
4546
[._]*.sw[a-p]

CMakeLists.txt

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

1212
# project name and version should be set after cmake_policy CMP0048
13-
set(PROJECT_VERSION "0.6.2")
13+
set(PROJECT_VERSION "0.6.3")
1414
project(solidity VERSION ${PROJECT_VERSION} LANGUAGES C CXX)
1515

1616
include(TestBigEndian)
@@ -55,6 +55,7 @@ add_subdirectory(libevmasm)
5555
add_subdirectory(libyul)
5656
add_subdirectory(libsolidity)
5757
add_subdirectory(libsolc)
58+
add_subdirectory(tools)
5859

5960
if (NOT EMSCRIPTEN)
6061
add_subdirectory(solc)

Changelog.md

+23
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
### 0.6.3 (2020-02-18)
2+
3+
Language Features:
4+
* Allow contract types and enums as keys for mappings.
5+
* Allow function selectors to be used as compile-time constants.
6+
* Report source locations for structured documentation errors.
7+
8+
9+
10+
Compiler Features:
11+
* AST: Add a new node for doxygen-style, structured documentation that can be received by contract, function, event and modifier definitions.
12+
* Code Generator: Use ``calldatacopy`` instead of ``codecopy`` to zero out memory past input.
13+
* Debug: Provide reason strings for compiler-generated internal reverts when using the ``--revert-strings`` option or the ``settings.debug.revertStrings`` setting on ``debug`` mode.
14+
* Yul Optimizer: Prune functions that call each other but are otherwise unreferenced.
15+
16+
17+
Bugfixes:
18+
* Assembly: Added missing `source` field to legacy assembly json output to complete the source reference.
19+
* Parser: Fix an internal error for ``abstract`` without ``contract``.
20+
* Type Checker: Make invalid calls to uncallable types fatal errors instead of regular.
21+
22+
23+
124
### 0.6.2 (2020-01-27)
225

326
Language Features:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# The Solidity Contract-Oriented Programming Language
2-
[![Join the chat at https://gitter.im/ethereum/solidity](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereum/solidity?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2+
You can talk to us on [![solidity at https://gitter.im/ethereum/solidity](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereum/solidity?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge). Questions, feedback and suggestions are welcome!
33

44
Solidity is a statically typed, contract-oriented, high-level language for implementing smart contracts on the Ethereum platform.
55

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ test_script:
7171
- soltest.exe --show-progress -- --testpath %APPVEYOR_BUILD_FOLDER%\test --no-smt
7272
# Skip bytecode compare if private key is not available
7373
- cd %APPVEYOR_BUILD_FOLDER%
74-
- ps: if ($env:priv_key) {
74+
- ps: if ($env:priv_key -and -not $env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT) {
7575
scripts\bytecodecompare\storebytecode.bat $Env:CONFIGURATION $bytecodedir
7676
}
7777
- cd %APPVEYOR_BUILD_FOLDER%\build\test\%CONFIGURATION%

cmake/EthCompilerSettings.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
5454
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 5.0 or greater.")
5555
endif ()
5656

57+
# Use fancy colors in the compiler diagnostics
58+
add_compile_options(-fdiagnostics-color)
59+
5760
# Additional Clang-specific compiler settings.
5861
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
5962
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")

cmake/toolchains/libfuzzer.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ set(USE_CVC4 OFF CACHE BOOL "Disable CVC4" FORCE)
77
set(OSSFUZZ ON CACHE BOOL "Enable fuzzer build" FORCE)
88
# Use libfuzzer as the fuzzing back-end
99
set(LIB_FUZZING_ENGINE "-fsanitize=fuzzer" CACHE STRING "Use libfuzzer back-end" FORCE)
10-
# clang/libfuzzer specific flags for ASan instrumentation
11-
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)
10+
# clang/libfuzzer specific flags for UBSan instrumentation
11+
set(CMAKE_CXX_FLAGS "-O1 -gline-tables-only -fsanitize=undefined -fsanitize=fuzzer-no-link -stdlib=libstdc++" CACHE STRING "Custom compilation flags" FORCE)

docs/050-breaking-changes.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ This section highlights changes that affect syntax and semantics.
6363
last one only works for value types). Change every ``keccak256(a, b, c)`` to
6464
``keccak256(abi.encodePacked(a, b, c))``. Even though it is not a breaking
6565
change, it is suggested that developers change
66-
``x.call(bytes4(keccak256("f(uint256)"), a, b)`` to
66+
``x.call(bytes4(keccak256("f(uint256)")), a, b)`` to
6767
``x.call(abi.encodeWithSignature("f(uint256)", a, b))``.
6868

6969
* Functions ``.call()``, ``.delegatecall()`` and ``.staticcall()`` now return
@@ -455,7 +455,7 @@ New version:
455455
uint z = someInteger();
456456
x += z;
457457
// Throw is now disallowed.
458-
require(x > 100);
458+
require(x <= 100);
459459
int y = -3 >> 1;
460460
require(y == -2);
461461
do {

docs/bugs_by_version.json

+4
Original file line numberDiff line numberDiff line change
@@ -884,5 +884,9 @@
884884
"0.6.2": {
885885
"bugs": [],
886886
"released": "2020-01-27"
887+
},
888+
"0.6.3": {
889+
"bugs": [],
890+
"released": "2020-02-18"
887891
}
888892
}

docs/conf.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@
1717
import os
1818
import re
1919

20+
from pygments_lexer_solidity import SolidityLexer
21+
2022
# If extensions (or modules to document with autodoc) are in another directory,
2123
# add these directories to sys.path here. If the directory is relative to the
2224
# documentation root, use os.path.abspath to make it absolute, like shown here.
2325

2426
def setup(sphinx):
2527
thisdir = os.path.dirname(os.path.realpath(__file__))
2628
sys.path.insert(0, thisdir + '/utils')
27-
from pygments_lexer_solidity import SolidityLexer
2829
sphinx.add_lexer('Solidity', SolidityLexer())
2930

3031
sphinx.add_stylesheet('css/custom.css')
@@ -53,7 +54,7 @@ def setup(sphinx):
5354

5455
# General information about the project.
5556
project = 'Solidity'
56-
copyright = '2016-2019, Ethereum'
57+
copyright = '2016-2020, Ethereum'
5758

5859
# The version info for the project you're documenting, acts as replacement for
5960
# |version| and |release|, also used in various other places throughout the

docs/contracts/constant-state-variables.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ value types and strings.
2929
pragma solidity >=0.4.0 <0.7.0;
3030

3131
contract C {
32-
uint constant x = 32**22 + 8;
33-
string constant text = "abc";
34-
bytes32 constant myHash = keccak256("abc");
32+
uint constant X = 32**22 + 8;
33+
string constant TEXT = "abc";
34+
bytes32 constant MY_HASH = keccak256("abc");
3535
}

docs/control-structures.rst

+10
Original file line numberDiff line numberDiff line change
@@ -717,3 +717,13 @@ in scope in the block that follows.
717717
in a catch block or the execution of the try/catch statement itself
718718
reverts (for example due to decoding failures as noted above or
719719
due to not providing a low-level catch clause).
720+
721+
.. note::
722+
The reason behind a failed call can be manifold. Do not assume that
723+
the error message is coming directly from the called contract:
724+
The error might have happened deeper down in the call chain and the
725+
called contract just forwarded it. Also, it could be due to an
726+
out-of-gas situation and not a deliberate error condition:
727+
The caller always retains 63/64th of the gas in a call and thus
728+
even if the called contract goes out of gas, the caller still
729+
has some gas left.

docs/grammar.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ TypeName = ElementaryTypeName
5959

6060
UserDefinedTypeName = Identifier ( '.' Identifier )*
6161

62-
Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
62+
Mapping = 'mapping' '(' ( ElementaryTypeName | UserDefinedTypeName ) '=>' TypeName ')'
6363
ArrayTypeName = TypeName '[' Expression? ']'
6464
FunctionTypeName = 'function' FunctionTypeParameterList ( 'internal' | 'external' | StateMutability )*
6565
( 'returns' FunctionTypeParameterList )?
@@ -96,6 +96,7 @@ Expression
9696
| IndexRangeAccess
9797
| MemberAccess
9898
| FunctionCall
99+
| Expression '{' NameValueList '}'
99100
| '(' Expression ')'
100101
| ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression
101102
| Expression '**' Expression

docs/types/mapping-types.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ Mapping Types
77
Mapping types use the syntax ``mapping(_KeyType => _ValueType)`` and variables
88
of mapping type are declared using the syntax ``mapping(_KeyType => _ValueType) _VariableName``.
99
The ``_KeyType`` can be any
10-
built-in value type plus ``bytes`` and ``string``. User-defined
11-
or complex types such as contract types, enums, mappings, structs or array types
12-
apart from ``bytes`` and ``string`` are not allowed.
10+
built-in value type, ``bytes``, ``string``, or any contract or enum type. Other user-defined
11+
or complex types, such as mappings, structs or array types are not allowed.
1312
``_ValueType`` can be any type, including mappings, arrays and structs.
1413

1514
You can think of mappings as `hash tables <https://en.wikipedia.org/wiki/Hash_table>`_, which are virtually initialised

0 commit comments

Comments
 (0)