Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
298 commits
Select commit Hold shift + click to select a range
78abe81
Merge branch 'develop' into externalFunctionsInLibraries
chriseth Mar 14, 2018
61d9f88
Merge pull request #3724 from ethereum/externalFunctionsInLibraries
chriseth Mar 14, 2018
acb8ea6
Merge pull request #3614 from ethereum/notestsOnTravis
axic Mar 15, 2018
f0c174a
Fix Typo in changelog.md
DanielRX Mar 15, 2018
3f1e0d8
Merge pull request #3740 from DanielMReed/patch-1
chriseth Mar 15, 2018
269241e
Add formatted printing to SyntaxTest and expand its public interface.
ekpyron Mar 12, 2018
7fa892e
Add interactive test tool isoltest.
ekpyron Mar 14, 2018
50ad89d
Only colour error type, not error message in isoltest.
ekpyron Mar 15, 2018
9e10956
Merge pull request #3709 from ethereum/syntaxTestsInteractiveTool
chriseth Mar 15, 2018
ea8d5f8
Use /usr/bin/editor if exists.
chriseth Mar 15, 2018
0a4d4d6
Remove ccache on circle.
chriseth Mar 15, 2018
6589555
Test extraction tool.
chriseth Mar 15, 2018
c9db105
Extract scoping tests.
chriseth Mar 15, 2018
e68c19c
Only consider files ending with .sol and not starting with ~ in synta…
ekpyron Mar 16, 2018
2b2527f
Merge pull request #3751 from ethereum/syntaxTestsExtensions
chriseth Mar 16, 2018
6e730df
Fix: Missing payable at function forceOwnerChange
mattaereal Mar 19, 2018
2cdf44f
Move the old ABI decoder code.
chriseth Feb 20, 2018
32c94f5
Simple size check for old ABI decoder.
chriseth Dec 13, 2017
cc2f71e
Move dynamic type removal out of the type system.
chriseth Feb 20, 2018
c2709a2
Decode dynamic data.
chriseth Feb 21, 2018
cc0f702
Tests for returning dynamic data.
chriseth Feb 21, 2018
c7860a0
Changelog entry.
chriseth Mar 9, 2018
cddb549
Merge pull request #3763 from mattaereal/patch-1
chriseth Mar 21, 2018
8fd53c1
Merge pull request #3744 from ethereum/useUsrBinEditor
axic Mar 21, 2018
85b0cfe
Merge pull request #3308 from ethereum/usereturndatacopy
chriseth Mar 21, 2018
ba209fe
Merge pull request #3746 from ethereum/disableCCache
chriseth Mar 21, 2018
9d9c0bf
Updates "How to contribute"
erak Mar 21, 2018
b79531b
Improve error message when trying to shift by fractional number
federicobond Mar 22, 2018
ef3595b
Allow overriding external functions in interfaces with public in an i…
axic Feb 27, 2018
8bae2db
Introduce inContractKind helper on FunctionDefinition
axic Mar 14, 2018
ed63202
Moves blockhash function to global level.
erak Mar 5, 2018
be35a65
Adds unit tests for moved function.
erak Mar 5, 2018
bddfa47
Updates docs for blockhash changes.
erak Mar 5, 2018
2c56e53
Changes deprecation and adjusts tests.
erak Mar 7, 2018
f8f50e1
Test that internal functions only used by constructor are not include…
chriseth Mar 8, 2018
0a67d61
Use shortcut for internal function calls to avoid runtime reference.
chriseth Mar 8, 2018
0a58e57
Changelog entry.
chriseth Mar 8, 2018
fab527c
Add runtimeOnly option to pushCombinedFunctionEntryLabel
axic Mar 27, 2018
80458b0
Explains test structure and update mechanism more detailed.
erak Mar 27, 2018
32f0898
Merge pull request #3646 from ethereum/blockhash-global
axic Mar 27, 2018
af26228
Merge pull request #3748 from ethereum/extractScopingTests
chriseth Mar 27, 2018
59538e9
Merge pull request #3686 from ethereum/doNotIncludeItnernal
chriseth Mar 27, 2018
8c1352c
Merge pull request #3772 from ethereum/docsTestingGuide
axic Mar 27, 2018
62559cf
Merge pull request #3681 from ethereum/interface-external
chriseth Mar 27, 2018
b540ba5
Disallow empty structs
axic Mar 27, 2018
ebb1275
Still allow empty structs for non-0.5.0 mode
axic Mar 27, 2018
3bb54e8
Merge pull request #3775 from federicobond/improve-error-fractional-s…
chriseth Mar 28, 2018
8a18f22
Support for error on non-existant or irregular files with command lin…
Mar 16, 2018
c2ae33f
Merge pull request #3754 from AnthonyBroadCrawford/error-on-missing-file
axic Mar 29, 2018
5c8a6aa
Prevent encoding of weird types and support packed encoding of extern…
chriseth Mar 16, 2018
58c57e4
Merge pull request #3753 from ethereum/whoSupportsPackedEncoding
axic Mar 29, 2018
326d656
Merge pull request #3790 from ethereum/empty-structs
chriseth Mar 30, 2018
8aadc17
Fix small formatting issue
wbt Mar 30, 2018
acd6ec0
Merge pull request #3800 from wbt/patch-2
axic Mar 30, 2018
076c075
Update tests for empty structs
axic Mar 30, 2018
be261ed
Merge pull request #3802 from ethereum/empty-structs
axic Mar 30, 2018
e37b619
Set default fixed point decimal places to 18
randomnetcat Feb 16, 2018
29df18d
Remove brew linkapps from the installation instructions
axic Mar 31, 2018
884ea39
Removed documentation reference to the now-depricated var tuple varia…
kevinflo Apr 2, 2018
826de65
fix a wrong number
haoliangyu Apr 3, 2018
3fbdd65
Merge pull request #3807 from haoliangyu/patch-1
chriseth Apr 3, 2018
3d0b997
Merge pull request #3803 from ethereum/homebrew
chriseth Apr 3, 2018
d213821
Merge pull request #3801 from meowingtwurtle/preFixedPoint
chriseth Apr 3, 2018
8fe1cfb
Defaults to external visibility for interfaces.
erak Mar 9, 2018
601659c
Moves all interface function visibility related tests.
erak Mar 23, 2018
f9efa41
Makes visibility warning more concise.
erak Mar 28, 2018
6777f7a
Optimize across MLOAD if MSIZE is not used.
chriseth Mar 8, 2018
138dba1
Test number of sstore operations.
chriseth Mar 13, 2018
e64e397
Add memory array init test.
chriseth Mar 30, 2018
deadff2
Changelog entry.
chriseth Mar 30, 2018
a54fdc4
Fix: Treat empty base constructor argument list as not provided.
chriseth Mar 16, 2018
19f2887
Merge pull request #3757 from ethereum/fixEmptyBaseArguments
axic Apr 3, 2018
7753249
Merge pull request #3699 from ethereum/interfaceExternalVisibility
axic Apr 3, 2018
c42caed
Extract recursive struct tests.
chriseth Mar 15, 2018
5bdadff
Fix detection of recursive structs.
chriseth Mar 15, 2018
eb5b18e
Generalize cycle detection.
chriseth Mar 15, 2018
8fdbd19
Extract constant cycle tests.
chriseth Mar 15, 2018
0edce4b
Merge pull request #3693 from ethereum/optimizeMLOAD
axic Apr 3, 2018
8cbb1d3
Build on tag in Circle.
chriseth Apr 3, 2018
3b008c7
Require node 8 for Javascript tests
axic Feb 12, 2018
d664a59
Constructors are defined using the ``constructor`` keyword.
ekpyron Mar 1, 2018
07c74ef
Updates docs to new constructor syntax.
erak Mar 2, 2018
c98464d
Remove redundant test and enforce success without warnings.
ekpyron Mar 5, 2018
f855c78
Update version pragma and use new constructor syntax in std/ contracts.
ekpyron Mar 6, 2018
e2dac9e
Set header.isConstructor for old style constructors in parseFunctionH…
ekpyron Mar 7, 2018
8f66390
Set isConstructor to false unconditionally and update to true later f…
ekpyron Mar 9, 2018
3ae3261
Document absence of constructors.
ekpyron Mar 9, 2018
104a973
Merge pull request #3809 from ethereum/build_on_tags
axic Apr 3, 2018
17bcabb
Remove useless SWAP1 in front of commutative operations
axic Mar 29, 2018
be6051b
Test multiple instructions with the (non)commutative peephole optimiser
axic Apr 3, 2018
6f9644a
SyntaxTests: extend syntax tests and isoltest to support parser error…
ekpyron Apr 3, 2018
87ad337
Adds parsing sub-directory in syntaxTests and moves two example tests…
ekpyron Apr 3, 2018
0695ffe
Merge pull request #3635 from ethereum/constructor-modifier
axic Apr 3, 2018
86c5d6a
hash256 -> bytes32 fix in misleading note
romfrolov Apr 4, 2018
920de49
Merge pull request #3798 from ethereum/commutative-swap
axic Apr 4, 2018
c63efeb
Merge pull request #3814 from FrolovR/patch-2
axic Apr 4, 2018
fa92380
Add scripts to build the eth binary via docker.
chriseth Apr 4, 2018
0cbe550
Create empty dynamic memory arrays more efficiently.
chriseth Mar 13, 2018
c5c5b23
Merge pull request #3817 from ethereum/eth_docker
axic Apr 4, 2018
2fe5607
Merge pull request #3721 from ethereum/simpleDynArray
chriseth Apr 4, 2018
016f562
Merge pull request #3808 from ethereum/parserTests
chriseth Apr 4, 2018
0f7e187
Clarify code state of contracts under construction.
chriseth Apr 4, 2018
efa0cca
Merge pull request #3820 from ethereum/chriseth-patch-1
chriseth Apr 4, 2018
65f18a1
More specific push implementation.
chriseth Mar 8, 2018
02ea0e5
Replace comparison operators with opposites if preceded by SWAP1
axic Apr 4, 2018
7cf0994
Merge pull request #3657 from ethereum/codingStyle
chriseth Apr 5, 2018
d662622
Variable assignment wording change
kevinflo Apr 5, 2018
c6adad9
Merge pull request #3690 from ethereum/incrementArraySize
axic Apr 5, 2018
8dc9113
Add end-to-end test for SwapComparison and CommutativeSwap peephole o…
axic Apr 5, 2018
96eff0f
Error when using empty parenthesis for base class constructors that r…
ekpyron Apr 4, 2018
c6da5c1
Merge pull request #3822 from ethereum/swap-comparison
chriseth Apr 5, 2018
7f23235
Show JSON error if jsonParseStrict failed in soltest
axic Apr 5, 2018
36d6c27
Merge pull request #3745 from ethereum/fixRecursion
axic Apr 5, 2018
ac6a304
Support constantinople in soltest
axic Apr 5, 2018
8d087d1
[SMTChecker] Removing usage of UFs to access SSA indices
Apr 5, 2018
251e4cf
Document use of AFL.
chriseth Apr 5, 2018
037eba2
Merge pull request #3824 from ethereum/baseArgumentsEmptyParenthesis
ekpyron Apr 5, 2018
e0f8657
Merge pull request #3826 from ethereum/document_afl
axic Apr 5, 2018
2d22549
Merge pull request #3827 from ethereum/constantinople
chriseth Apr 5, 2018
95b0589
Merge pull request #3828 from ethereum/soltest
chriseth Apr 5, 2018
5b1c050
Allow ``memory`` suffix for internal elementary type parsing.
chriseth Dec 30, 2017
4c50ed3
Merge pull request #3829 from ethereum/smt_remove_uf
chriseth Apr 5, 2018
d74b71a
Merge pull request #3805 from kevinflo/tuple-documentation-var-removal
chriseth Apr 5, 2018
543e1e1
Merge pull request #3831 from ethereum/memory-suffix
chriseth Apr 5, 2018
6a2c30e
Fix trusty build script for eth.
chriseth Apr 4, 2018
3c64313
Use new eth binaries.
chriseth Apr 5, 2018
309a90b
Merge pull request #3818 from ethereum/eth_docker
chriseth Apr 5, 2018
f39f36f
Fix file missing error message on imports.
q3k Oct 3, 2017
9bd4951
Merge pull request #3833 from ethereum/newEthBinaries
chriseth Apr 6, 2018
d5f40c1
Limit the number of errors output in a single run to 256
axic Dec 12, 2017
e8be0e6
Catch FatalError in CompilerStack::analysis to cover all the analysis…
axic Apr 5, 2018
3730f68
reindent
axic Apr 5, 2018
0812d11
Ignore warnings when limited errors to 256
axic Apr 5, 2018
43d2954
Do not abort excessive warnings, just ignore them.
axic Apr 5, 2018
a38418f
Common subexpression eliminator.
chriseth Feb 2, 2018
866df15
Merge pull request #3832 from ethereum/commonSubexpressionEliminator
chriseth Apr 6, 2018
49567b3
Update Delegatecall Description in Docs
RobbieFerguson Feb 27, 2018
12ba3ee
Merge pull request #3609 from RobbieFerguson/patch-1
chriseth Apr 6, 2018
b2753aa
Static Analyzer: Fix non-deterministic order of unused variable warni…
ekpyron Apr 6, 2018
fe61435
Merge pull request #3839 from ethereum/unusedVariableWarningOrder
chriseth Apr 6, 2018
4e03728
Error on duplicated super constructor calls
federicobond Dec 11, 2017
b8fdb66
Allow duplicated constructor calls, if no arguments; support for mult…
ekpyron Apr 4, 2018
b918a10
Move constructor argument override check to TypeChecker and reuse ann…
ekpyron Apr 5, 2018
549ba80
Use the most derived contract as main location in case of diamond inh…
ekpyron Apr 9, 2018
089c295
Update solidity-by-example.rst
netrunnerX Apr 5, 2018
cb352ed
Add constant optimiser for SHR/SHL instructions
axic May 10, 2017
aaa8edc
Fixed typos
hydai Apr 10, 2018
27385d6
Merge pull request #3852 from hydai/fix_typo
chriseth Apr 10, 2018
b526141
Merge pull request #3821 from ethereum/warn-constructor-override
chriseth Apr 10, 2018
0546a36
Merge pull request #3836 from netrunnerX/develop
chriseth Apr 10, 2018
3eedbc6
Error when using no parentheses in modifier-style constructor calls.
ekpyron Apr 10, 2018
2bc4ec3
Merge pull request #3853 from ethereum/modifierStyleWithoutParentheses
ekpyron Apr 10, 2018
f036957
Add source locations to syntax test expectations.
ekpyron Apr 6, 2018
41d81a7
Merge pull request #3842 from ethereum/syntaxTestsSourceLocations
ekpyron Apr 10, 2018
5f76f47
Add end to end tests for SHL/SHR/SAR instructions (constantinople only)
axic Apr 9, 2018
4450034
Run tests in constantinople mode too
axic Apr 6, 2018
2e73ef5
Ignore shift warnings on constantinople tests
axic Apr 6, 2018
3b7b962
Fix bug in typechecking when comparing rational literals
randomnetcat Apr 10, 2018
b7b6d0c
Merge pull request #3799 from meowingtwurtle/fixLiteralComparisons
chriseth Apr 11, 2018
c9bdbcf
Merge pull request #3309 from ethereum/limit-errors
chriseth Apr 11, 2018
05781c9
Fix line numbers for errors.
chriseth Apr 11, 2018
29bde7f
Merge pull request #3859 from ethereum/fixerrorlines
chriseth Apr 11, 2018
d50d1f0
Merge pull request #3580 from ethereum/asm-bitshift-optim
chriseth Apr 11, 2018
fdcbf13
Syntax Tests: extract array_length_* tests.
ekpyron Apr 11, 2018
cb548f6
Fix ConstantEvaluator to correctly handle single element tuples.
ekpyron Apr 11, 2018
c15cb6c
Prevent information about file existence outside the allowed paths to…
ekpyron Apr 5, 2018
928ce08
Correctly ignore costs of fallback for other functions.
chriseth Apr 11, 2018
418e272
Merge pull request #3862 from ethereum/fixConstantEvaluatorTuples
axic Apr 11, 2018
576964b
Mark --formal as deprecated in CLI options
ldct Apr 11, 2018
daa69df
Error on invalid arithmetic with constant expressions.
ekpyron Apr 9, 2018
8d355df
Merge pull request #3830 from ethereum/fix-include-paths-errors
ekpyron Apr 11, 2018
ae3fca6
Merge pull request #3863 from ethereum/fixGasEstimation
chriseth Apr 11, 2018
7626c8a
Merge pull request #3855 from ldct/patch-3
axic Apr 11, 2018
bd27ce0
Extract function type tests.
chriseth Mar 16, 2018
08e807a
Add expectations.
chriseth Mar 16, 2018
6d28978
Fix state variable parsing.
chriseth Mar 16, 2018
42b90ad
New tests for function state variables.
chriseth Mar 16, 2018
d64e933
Changelog entry.
chriseth Mar 16, 2018
2ad1aca
Warn if modifiers are applied to functions without implementation.
chriseth Mar 16, 2018
4e1ea08
Extract modifier tests.
chriseth Mar 16, 2018
52f68d3
Update expectations.
chriseth Apr 11, 2018
b5a696a
Properly cope with constructor headers.
chriseth Apr 11, 2018
ee5d0ef
Merge pull request #3752 from ethereum/fixStateVariableParsing
chriseth Apr 11, 2018
d56acb6
Add abi.encode, abi.encodePacked, abi.encodeWithSelector and abi.enco…
axic Jul 31, 2017
9329156
Add tests for literal operations as well.
ekpyron Apr 11, 2018
ea445b9
Merge pull request #3485 from ethereum/js-tests-node8
chriseth Apr 11, 2018
44c0d7c
Tests.
chriseth Mar 21, 2018
c4a6a63
Tests for view and pure.
chriseth Mar 21, 2018
7343c40
Check partial function parameters if rest is arbitrary.
chriseth Mar 21, 2018
2192e40
Update version pragmas from >0.4.21 to ^0.4.22.
ekpyron Apr 6, 2018
d42476e
Add test to check ConstantEvaluator for pure non-rational functions.
ekpyron Apr 12, 2018
c3dc67d
Merge pull request #3848 from ethereum/constantDivisionByZero
chriseth Apr 12, 2018
17fc0f5
Use FunctionTypePointer (adds ``const``).
chriseth Dec 30, 2017
f00bb43
Allow function overloads involving MagicVariableDeclarations.
chriseth Dec 30, 2017
8ab7dc0
Register overload for ``revert()`` that can receive a reason string.
chriseth Dec 30, 2017
012ab37
Code generator for revert with reason string.
chriseth Dec 30, 2017
a06249c
Tests for revert with reason string.
chriseth Dec 30, 2017
3da16b3
Documentation for revert with reason string.
chriseth Dec 30, 2017
ae1d040
Allow error string for ``require``.
chriseth Dec 30, 2017
7a9ee69
Bubble up error messages.
chriseth Dec 30, 2017
aa715f8
Tests about error bubbling for create and transfer.
chriseth Jan 3, 2018
344a388
Update documentation.
chriseth Jan 3, 2018
43b1dd7
Changelog entry.
chriseth Jan 3, 2018
167ee2f
Update source location tests.
chriseth Jan 4, 2018
42c4c78
Adjust tests.
chriseth Jan 4, 2018
fcb7a27
Only forward returndata if EVM version supports it.
chriseth Mar 2, 2018
e133b1a
Adjust expectations in case of homestead VM.
chriseth Mar 6, 2018
338a875
Update expectation.
chriseth Apr 4, 2018
4faa839
Use error signature for revert data.
chriseth Apr 6, 2018
b255981
Update documentation and minor changes.
chriseth Apr 6, 2018
6862f22
Fix internal compiler error when parsing ``var`` declaration without …
ekpyron Apr 12, 2018
75b8828
Allow struct encoding with new encoder.
chriseth Apr 5, 2018
db40bd4
Add additional test for ``var`` for storage variables.
ekpyron Apr 12, 2018
7453ff0
Merge pull request #3873 from ethereum/returnVarStorage
axic Apr 12, 2018
9663673
Remove dead code and clarify throw.
chriseth Apr 12, 2018
44416d1
Merge pull request #2980 from ethereum/abi-api
chriseth Apr 12, 2018
7054def
Merge pull request #3364 from ethereum/revertWithReason
chriseth Apr 12, 2018
8935c0d
Uses short string representation of TypePointer
erak Mar 21, 2018
8240083
Adds type expectations to legacy tests.
erak Apr 9, 2018
34da3e6
Separates tests for legacy and compact output.
erak Apr 9, 2018
6c656a9
Adds unit test that covers long typeDescription and renames suite.
erak Apr 9, 2018
4bd31aa
Add ChangeLog entry.
ekpyron Apr 12, 2018
2001cc6
Merge pull request #3773 from ethereum/astJsonTypeDescriptions
chriseth Apr 13, 2018
be37e3a
Stricter check for member access to "this" in constructor.
ekpyron Apr 12, 2018
05c5ab1
Improve documentation and warning about accessing contract members in…
ekpyron Apr 13, 2018
559fa58
Document ABI encoding functions.
chriseth Apr 13, 2018
95c49b3
Merge pull request #3875 from ethereum/constructorSelfRef
chriseth Apr 13, 2018
73ca3e8
Merge pull request #3882 from ethereum/abi_doc
axic Apr 14, 2018
8a72246
Docs: Update solidity version for revert with reason
LefterisJP Apr 15, 2018
d8030c9
Merge pull request #3880 from ethereum/addressMemberDocAndWarn
chriseth Apr 16, 2018
33fbf88
Limits rational numbers to 4096 bits.
erak Mar 26, 2018
cdb0bbb
CMake: Do no search for ctest
chfast Apr 16, 2018
1ca8aeb
CMake: Clean up devcore dependencies
chfast Apr 16, 2018
4c1d39b
Properly force-clean for shortening bytesXX conversions.
chriseth Apr 11, 2018
0201492
Remove redundant cleanup for abi.encode.
axic Apr 13, 2018
bf57500
Tests for bytes cleanup.
chriseth Apr 13, 2018
a9c16b8
Add documentation.
chriseth Apr 16, 2018
8be19ad
Merge pull request #3888 from ethereum/cmake-cleanups
chriseth Apr 16, 2018
533d085
Merge pull request #3793 from ethereum/rationalNumberLimit
chriseth Apr 16, 2018
3d04d83
Merge pull request #3868 from ethereum/bytescleanup
chriseth Apr 16, 2018
936832b
Preparation for 0.4.22 release.
chriseth Apr 16, 2018
923d1b4
Merge pull request #3891 from ethereum/prepareForRelease
chriseth Apr 16, 2018
8be4cba
Merge pull request #3865 from ethereum/updateConstructorVersionPragmas
chriseth Apr 16, 2018
af18b4d
Merge pull request #3885 from LefterisJP/update_solidity_version_wher…
chriseth Apr 16, 2018
c65159c
Preparation for 0.4.22 release.
chriseth Apr 16, 2018
2db8b8a
Merge pull request #3893 from ethereum/prepareForRelease
chriseth Apr 16, 2018
7599285
Show progress on travis.
chriseth Apr 16, 2018
f87f5d0
Merge pull request #3896 from ethereum/progressOnTravis
chriseth Apr 16, 2018
6091cd5
Disable tests on travis.
chriseth Apr 16, 2018
b8431c5
Merge pull request #3897 from ethereum/noTestsOnTravis
chriseth Apr 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ matrix:
sudo: required
compiler: gcc
node_js:
- "7"
- "8"
services:
- docker
before_install:
- nvm install 7
- nvm use 7
- nvm install 8
- nvm use 8
- docker pull trzeci/emscripten:sdk-tag-1.35.4-64bit
env:
- SOLC_EMSCRIPTEN=On
Expand Down Expand Up @@ -159,6 +159,8 @@ cache:
install:
- test $SOLC_INSTALL_DEPS_TRAVIS != On || (scripts/install_deps.sh)
- test "$TRAVIS_OS_NAME" != "linux" || (scripts/install_cmake.sh)
# - if [ "$TRAVIS_BRANCH" != release -a -z "$TRAVIS_TAG" ]; then SOLC_TESTS=Off; fi
- SOLC_TESTS=Off
- 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

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include(EthPolicy)
eth_policy()

# project name and version should be set after cmake_policy CMP0048
set(PROJECT_VERSION "0.4.21")
set(PROJECT_VERSION "0.4.22")
project(solidity VERSION ${PROJECT_VERSION})

option(SOLC_LINK_STATIC "Link solc executable statically on supported platforms" OFF)
Expand Down
262 changes: 262 additions & 0 deletions CODING_STYLE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
0. Formatting

GOLDEN RULE: Follow the style of the existing code when you make changes.

a. Use tabs for leading indentation
- tab stops are every 4 characters (only relevant for line length).
- One indentation level -> exactly one byte (i.e. a tab character) in the source file.
b. Line widths:
- Lines should be at most 99 characters wide to make diff views readable and reduce merge conflicts.
- Lines of comments should be formatted according to ease of viewing, but simplicity is to be preferred over beauty.
c. Single-statement blocks should not have braces, unless required for clarity.
d. Never place condition bodies on same line as condition.
e. Space between keyword and opening parenthesis, but not following opening parenthesis or before final parenthesis.
f. No spaces for unary operators, `->` or `.`.
g. No space before ':' but one after it, except in the ternary operator: one on both sides.
h. Add spaces around all other operators.
i. Braces, when used, always have their own lines and are at same indentation level as "parent" scope.
j. If lines are broken, a list of elements enclosed with parentheses (of any kind) and separated by a
separator (of any kind) are formatted such that there is exactly one element per line, followed by
the separator, the opening parenthesis is on the first line, followed by a line break and the closing
parenthesis is on a line of its own (unindented). See example below.

(WRONG)
if( a==b[ i ] ) { printf ("Hello\n"); }
foo->bar(someLongVariableName,
anotherLongVariableName,
anotherLongVariableName,
anotherLongVariableName,
anotherLongVariableName);
cout << "some very long string that contains completely irrelevant text that talks about this and that and contains the words \"lorem\" and \"ipsum\"" << endl;

(RIGHT)
if (a == b[i])
printf("Hello\n"); // NOTE spaces used instead of tab here for clarity - first byte should be '\t'.
foo->bar(
someLongVariableName,
anotherLongVariableName,
anotherLongVariableName,
anotherLongVariableName,
anotherLongVariableName
);
cout <<
"some very long string that contains completely irrelevant " <<
"text that talks about this and that and contains the words " <<
"\"lorem\" and \"ipsum\"" <<
endl;



1. Namespaces;

a. No "using namespace" declarations in header files.
b. All symbols should be declared in a namespace except for final applications.
c. Use anonymous namespaces for helpers whose scope is a cpp file only.
d. Preprocessor symbols should be prefixed with the namespace in all-caps and an underscore.

(WRONG)
#include <cassert>
using namespace std;
tuple<float, float> meanAndSigma(vector<float> const& _v);

(CORRECT)
#include <cassert>
std::tuple<float, float> meanAndSigma(std::vector<float> const& _v);



2. Preprocessor;

a. File comment is always at top, and includes:
- Copyright.
- License (e.g. see COPYING).
b. Never use #ifdef/#define/#endif file guards. Prefer #pragma once as first line below file comment.
c. Prefer static const variable to value macros.
d. Prefer inline constexpr functions to function macros.
e. Split complex macro on multiple lines with '\'.



3. Capitalization;

GOLDEN RULE: Preprocessor: ALL_CAPS; C++: camelCase.

a. Use camelCase for splitting words in names, except where obviously extending STL/boost functionality in which case follow those naming conventions.
b. The following entities' first alpha is upper case:
- Type names.
- Template parameters.
- Enum members.
- static const variables that form an external API.
c. All preprocessor symbols (macros, macro arguments) in full uppercase with underscore word separation.


All other entities' first alpha is lower case.



4. Variable prefixes:

a. Leading underscore "_" to parameter names.
- Exception: "o_parameterName" when it is used exclusively for output. See 6(f).
- Exception: "io_parameterName" when it is used for both input and output. See 6(f).
b. Leading "g_" to global (non-const) variables.
c. Leading "s_" to static (non-const, non-global) variables.



5. Assertions:

- use `solAssert` and `solUnimplementedAssert` generously to check assumptions
that span across different parts of the code base, for example before dereferencing
a pointer.


6. Declarations:

a. {Typename} + {qualifiers} + {name}.
b. Only one per line.
c. Associate */& with type, not variable (at ends with parser, but more readable, and safe if in conjunction with (b)).
d. Favour declarations close to use; don't habitually declare at top of scope ala C.
e. Pass non-trivial parameters as const reference, unless the data is to be copied into the function, then either pass by const reference or by value and use std::move.
f. If a function returns multiple values, use std::tuple (std::pair acceptable) or better introduce a struct type. Do not use */& arguments.
g. Use parameters of pointer type only if ``nullptr`` is a valid argument, use references otherwise. Often, ``boost::optional`` is better suited than a raw pointer.
h. Never use a macro where adequate non-preprocessor C++ can be written.
i. Only use ``auto`` if the type is very long and rather irrelevant.
j. Do not pass bools: prefer enumerations instead.
k. Prefer enum class to straight enum.
l. Always initialize POD variables, even if their value is overwritten later.


(WRONG)
const double d = 0;
int i, j;
char *s;
float meanAndSigma(std::vector<float> _v, float* _sigma, bool _approximate);
Derived* x(dynamic_cast<Derived*>(base));
for (map<ComplexTypeOne, ComplexTypeTwo>::iterator i = l.begin(); i != l.end(); ++l) {}


(CORRECT)
enum class Accuracy
{
Approximate,
Exact
};
struct MeanSigma
{
float mean;
float standardDeviation;
};
double const d = 0;
int i;
int j;
char* s;
MeanAndSigma ms meanAndSigma(std::vector<float> const& _v, Accuracy _a);
Derived* x = dynamic_cast<Derived*>(base);
for (auto i = x->begin(); i != x->end(); ++i) {}


7. Structs & classes

a. Structs to be used when all members public and no virtual functions.
- In this case, members should be named naturally and not prefixed with 'm_'
b. Classes to be used in all other circumstances.



8. Members:

a. One member per line only.
b. Private, non-static, non-const fields prefixed with m_.
c. Avoid public fields, except in structs.
d. Use override, final and const as much as possible.
e. No implementations with the class declaration, except:
- template or force-inline method (though prefer implementation at bottom of header file).
- one-line implementation (in which case include it in same line as declaration).
f. For a property 'foo'
- Member: m_foo;
- Getter: foo() [ also: for booleans, isFoo() ];
- Setter: setFoo();



9. Naming

a. Avoid unpronouncable names
b. Names should be shortened only if they are extremely common, but shortening should be generally avoided
c. Avoid prefixes of initials (e.g. do not use IMyInterface, CMyImplementation)
c. Find short, memorable & (at least semi-) descriptive names for commonly used classes or name-fragments.
- A dictionary and thesaurus are your friends.
- Spell correctly.
- Think carefully about the class's purpose.
- Imagine it as an isolated component to try to decontextualise it when considering its name.
- Don't be trapped into naming it (purely) in terms of its implementation.



10. Type-definitions

a. Prefer 'using' to 'typedef'. e.g. using ints = std::vector<int>; rather than typedef std::vector<int> ints;
b. Generally avoid shortening a standard form that already includes all important information:
- e.g. stick to shared_ptr<X> rather than shortening to ptr<X>.
c. Where there are exceptions to this (due to excessive use and clear meaning), note the change prominently and use it consistently.
- e.g. using Guard = std::lock_guard<std::mutex>; ///< Guard is used throughout the codebase since it is clear in meaning and used commonly.
d. In general expressions should be roughly as important/semantically meaningful as the space they occupy.
e. Avoid introducing aliases for types unless they are very complicated. Consider the number of items a brain can keep track of at the same time.



11. Commenting

a. Comments should be doxygen-compilable, using @notation rather than \notation.
b. Document the interface, not the implementation.
- Documentation should be able to remain completely unchanged, even if the method is reimplemented.
- Comment in terms of the method properties and intended alteration to class state (or what aspects of the state it reports).
- Be careful to scrutinise documentation that extends only to intended purpose and usage.
- Reject documentation that is simply an English transaction of the implementation.
c. Avoid in-code comments. Instead, try to extract blocks of functionality into functions. This often already eliminates the need for an in-code comment.


12. Include Headers

Includes should go in increasing order of generality (libsolidity -> libevmasm -> libdevcore -> boost -> STL).
The corresponding .h file should be the first include in the respective .cpp file.
Insert empty lines between blocks of include files.

Example:

```
#include <libsolidity/codegen/ExpressionCompiler.h>

#include <libsolidity/ast/AST.h>
#include <libsolidity/codegen/CompilerContext.h>
#include <libsolidity/codegen/CompilerUtils.h>
#include <libsolidity/codegen/LValue.h>

#include <libevmasm/GasMeter.h>

#include <libdevcore/Common.h>
#include <libdevcore/SHA3.h>

#include <boost/range/adaptor/reversed.hpp>
#include <boost/algorithm/string/replace.hpp>

#include <utility>
#include <numeric>
```

See http://stackoverflow.com/questions/614302/c-header-order/614333#614333 for the reason: this makes it easier to find missing includes in header files.


13. Recommended reading

Herb Sutter and Bjarne Stroustrup
- "C++ Core Guidelines" (https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md)

Herb Sutter and Andrei Alexandrescu
- "C++ Coding Standards: 101 Rules, Guidelines, and Best Practices"

Scott Meyers
- "Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition)"
- "More Effective C++: 35 New Ways to Improve Your Programs and Designs"
- "Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14"
53 changes: 53 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
### 0.4.22 (2018-04-16)

Features:
* Code Generator: Initialize arrays without using ``msize()``.
* Code Generator: More specialized and thus optimized implementation for ``x.push(...)``
* Commandline interface: Error when missing or inaccessible file detected. Suppress it with the ``--ignore-missing`` flag.
* Constant Evaluator: Fix evaluation of single element tuples.
* General: Add encoding routines ``abi.encodePacked``, ``abi.encode``, ``abi.encodeWithSelector`` and ``abi.encodeWithSignature``.
* General: Add global function ``gasleft()`` and deprecate ``msg.gas``.
* General: Add global function ``blockhash(uint)`` and deprecate ``block.hash(uint)``.
* General: Allow providing reason string for ``revert()`` and ``require()``.
* General: Introduce new constructor syntax using the ``constructor`` keyword as experimental 0.5.0 feature.
* General: Limit the number of errors output in a single run to 256.
* General: Support accessing dynamic return data in post-byzantium EVMs.
* Inheritance: Error when using empty parentheses for base class constructors that require arguments as experimental 0.5.0 feature.
* Inheritance: Error when using no parentheses in modifier-style constructor calls as experimental 0.5.0 feature.
* Interfaces: Allow overriding external functions in interfaces with public in an implementing contract.
* Optimizer: Optimize ``SHL`` and ``SHR`` only involving constants (Constantinople only).
* Optimizer: Remove useless ``SWAP1`` instruction preceding a commutative instruction (such as ``ADD``, ``MUL``, etc).
* Optimizer: Replace comparison operators (``LT``, ``GT``, etc) with opposites if preceded by ``SWAP1``, e.g. ``SWAP1 LT`` is replaced with ``GT``.
* Optimizer: Optimize across ``mload`` if ``msize()`` is not used.
* Static Analyzer: Error on duplicated super constructor calls as experimental 0.5.0 feature.
* Syntax Checker: Issue warning for empty structs (or error as experimental 0.5.0 feature).
* Syntax Checker: Warn about modifiers on functions without implementation (this will turn into an error with version 0.5.0).
* Syntax Tests: Add source locations to syntax test expectations.
* Type Checker: Improve documentation and warnings for accessing contract members inherited from ``address``.


Bugfixes:
* Code Generator: Allow ``block.blockhash`` without being called.
* Code Generator: Do not include internal functions in the runtime bytecode which are only referenced in the constructor.
* Code Generator: Properly skip unneeded storage array cleanup when not reducing length.
* Code Generator: Bugfix in modifier lookup in libraries.
* Code Generator: Implement packed encoding of external function types.
* Code Generator: Treat empty base constructor argument list as not provided.
* Code Generator: Properly force-clean bytesXX types for shortening conversions.
* Commandline interface: Fix error messages for imported files that do not exist.
* Commandline interface: Support ``--evm-version constantinople`` properly.
* DocString Parser: Fix error message for empty descriptions.
* Gas Estimator: Correctly ignore costs of fallback function for other functions.
* JSON AST: Remove storage qualifier for type name strings.
* Parser: Fix internal compiler error when parsing ``var`` declaration without identifier.
* Parser: Fix parsing of getters for function type variables.
* Standard JSON: Support ``constantinople`` as ``evmVersion`` properly.
* Static Analyzer: Fix non-deterministic order of unused variable warnings.
* Static Analyzer: Invalid arithmetic with constant expressions causes errors.
* Type Checker: Fix detection of recursive structs.
* Type Checker: Fix asymmetry bug when comparing with literal numbers.
* Type System: Improve error message when attempting to shift by a fractional amount.
* Type System: Make external library functions accessible.
* Type System: Prevent encoding of weird types.
* Type System: Restrict rational numbers to 4096 bits.

### 0.4.21 (2018-03-07)

Features:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Useful links
To get started you can find an introduction to the language in the [Solidity documentation](https://solidity.readthedocs.org). In the documentation, you can find [code examples](https://solidity.readthedocs.io/en/latest/solidity-by-example.html) as well as [a reference](https://solidity.readthedocs.io/en/latest/solidity-in-depth.html) of the syntax and details on how to write smart contracts.

You can start using [Solidity in your browser](https://ethereum.github.io/browser-solidity/) with no need to download or compile anything.
You can start using [Solidity in your browser](http://remix.ethereum.org) with no need to download or compile anything.

The changelog for this project can be found [here](https://github.com/ethereum/solidity/blob/develop/Changelog.md).

Expand Down
1 change: 1 addition & 0 deletions ReleaseChecklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Checklist for making a release:
- [ ] Run ``scripts/release_ppa.sh release`` to create the PPA release (you need the relevant openssl key).
- [ ] Check that the Docker release was pushed to Docker Hub (this still seems to have problems).
- [ ] Update the homebrew realease in https://github.com/ethereum/homebrew-ethereum/blob/master/solidity.rb (version and hash)
- [ ] Update the default version on readthedocs.
- [ ] Make a release of ``solc-js``: Increment the version number, create a pull request for that, merge it after tests succeeded.
- [ ] Run ``npm publish`` in the updated ``solc-js`` repository.
- [ ] Create a commit to increase the version number on ``develop`` in ``CMakeLists.txt`` and add a new skeleton changelog entry.
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ build_script:

test_script:
- cd %APPVEYOR_BUILD_FOLDER%\build\test\%CONFIGURATION%
- soltest.exe --show-progress -- --no-ipc --no-smt
- soltest.exe --show-progress -- --testpath %APPVEYOR_BUILD_FOLDER%\test --no-ipc --no-smt
# Skip bytecode compare if private key is not available
- cd %APPVEYOR_BUILD_FOLDER%
- ps: if ($env:priv_key) {
Expand Down
Loading