From 77c335274426b8b8cb9ec3aaa9c87515ccc93458 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 5 Mar 2019 17:08:16 +0100 Subject: [PATCH 1/2] Some missed entries and set version to 0.6.0. --- CMakeLists.txt | 2 +- Changelog.md | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ebb4a615a..2293f264a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ include(EthPolicy) eth_policy() # project name and version should be set after cmake_policy CMP0048 -set(PROJECT_VERSION "0.5.5") +set(PROJECT_VERSION "0.6.0") project(solidity VERSION ${PROJECT_VERSION} LANGUAGES CXX) option(LLL "Build LLL" OFF) diff --git a/Changelog.md b/Changelog.md index b7ef05e25..d1384095b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,18 @@ +### 0.6.0 (unreleased) + +Language Features: + + +Compiler Features: + + +Bugfixes: + + +Build System: + + + ### 0.5.5 (2019-03-05) Language Features: @@ -7,10 +22,12 @@ Language Features: Compiler Features: * Support ``petersburg`` as ``evmVersion`` and set as default. + * Commandline Interface: Option to activate the experimental yul optimizer using ``-optimize-yul``. * Inline Assembly: Consider ``extcodehash`` as part of Constantinople. * Inline Assembly: Instructions unavailable to the currently configured EVM are errors now. * SMTChecker: Do not report underflow/overflow if they always revert. This removes false positives when using ``SafeMath``. * Standard JSON Interface: Allow retrieving metadata without triggering bytecode generation. + * Standard JSON Interface: Provide fine-grained control over the optimizer via the settings. * Static Analyzer: Warn about expressions with custom types when they have no effect. * Optimizer: Add new rules with constants including ``LT``, ``GT``, ``AND`` and ``BYTE``. * Optimizer: Add rule for shifts with constants for Constantinople. From 8d401ba9361b61bd63d659e0dfd567ad8069d241 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 5 Mar 2019 18:10:09 +0100 Subject: [PATCH 2/2] Update pragmas. --- docs/050-breaking-changes.rst | 8 +++--- docs/abi-spec.rst | 6 ++--- docs/assembly.rst | 10 +++---- docs/common-patterns.rst | 8 +++--- docs/contracts/abstract-contracts.rst | 4 +-- docs/contracts/constant-state-variables.rst | 2 +- docs/contracts/creating-contracts.rst | 2 +- docs/contracts/events.rst | 4 +-- docs/contracts/function-modifiers.rst | 2 +- docs/contracts/functions.rst | 18 ++++++------- docs/contracts/inheritance.rst | 12 ++++----- docs/contracts/interfaces.rst | 2 +- docs/contracts/libraries.rst | 4 +-- docs/contracts/using-for.rst | 4 +-- docs/contracts/visibility-and-getters.rst | 12 ++++----- docs/contributing.rst | 2 +- docs/control-structures.rst | 24 ++++++++--------- docs/examples/blind-auction.rst | 4 +-- docs/examples/micropayment.rst | 4 +-- docs/examples/modular.rst | 2 +- docs/examples/safe-remote.rst | 2 +- docs/examples/voting.rst | 2 +- docs/introduction-to-smart-contracts.rst | 4 +-- docs/layout-of-source-files.rst | 2 +- docs/miscellaneous.rst | 2 +- docs/security-considerations.rst | 10 +++---- docs/structure-of-a-contract.rst | 12 ++++----- docs/style-guide.rst | 30 ++++++++++----------- docs/types/mapping-types.rst | 2 +- docs/types/operators.rst | 2 +- docs/types/reference-types.rst | 12 ++++----- docs/types/value-types.rst | 8 +++--- 32 files changed, 111 insertions(+), 111 deletions(-) diff --git a/docs/050-breaking-changes.rst b/docs/050-breaking-changes.rst index 01d21c8c4..46ddc9abe 100644 --- a/docs/050-breaking-changes.rst +++ b/docs/050-breaking-changes.rst @@ -308,7 +308,7 @@ This will no longer compile with Solidity v0.5.0. However, you can define a comp :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; interface OldContract { function someOldFunction(uint8 a) external; function anotherOldFunction() external returns (bool); @@ -325,7 +325,7 @@ Given the interface defined above, you can now easily use the already deployed p :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; interface OldContract { function someOldFunction(uint8 a) external; @@ -345,7 +345,7 @@ commandline compiler for linking): :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; library OldLibrary { function someFunction(uint8 a) public returns(bool); @@ -430,7 +430,7 @@ New version: :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract OtherContract { uint x; diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst index fff087b0f..86e48ae90 100644 --- a/docs/abi-spec.rst +++ b/docs/abi-spec.rst @@ -212,7 +212,7 @@ Given the contract: :: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract Foo { function bar(bytes3[2] memory) public pure {} @@ -483,7 +483,7 @@ For example, :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract Test { constructor() public { b = hex"12345678901234567890123456789012"; } @@ -530,7 +530,7 @@ As an example, the code :: - pragma solidity >=0.4.19 <0.6.0; + pragma solidity >=0.4.19 <0.7.0; pragma experimental ABIEncoderV2; contract Test { diff --git a/docs/assembly.rst b/docs/assembly.rst index 953ebf48d..835ae11ac 100644 --- a/docs/assembly.rst +++ b/docs/assembly.rst @@ -76,7 +76,7 @@ idea is that assembly libraries will be used to enhance the Solidity language. .. code:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; library GetCode { function at(address _addr) public view returns (bytes memory o_code) { @@ -101,7 +101,7 @@ efficient code, for example: .. code:: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; library VectorSum { // This function is less efficient because the optimizer currently fails to @@ -394,7 +394,7 @@ Local Solidity variables are available for assignments, for example: .. code:: - pragma solidity >=0.4.11 <0.6.0; + pragma solidity >=0.4.11 <0.7.0; contract C { uint b; @@ -433,7 +433,7 @@ be just ``0``, but it can also be a complex functional-style expression. .. code:: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract C { function f(uint x) public view returns (uint b) { @@ -690,7 +690,7 @@ Example: We will follow an example compilation from Solidity to assembly. We consider the runtime bytecode of the following Solidity program:: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract C { function f(uint x) public pure returns (uint y) { diff --git a/docs/common-patterns.rst b/docs/common-patterns.rst index 65bf7f44f..5f15e3893 100644 --- a/docs/common-patterns.rst +++ b/docs/common-patterns.rst @@ -28,7 +28,7 @@ become the new richest. :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract WithdrawalContract { address public richest; @@ -65,7 +65,7 @@ This is as opposed to the more intuitive sending pattern: :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract SendContract { address payable public richest; @@ -130,7 +130,7 @@ restrictions highly readable. :: - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.7.0; contract AccessRestriction { // These will be assigned at the construction @@ -282,7 +282,7 @@ function finishes. :: - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.7.0; contract StateMachine { enum Stages { diff --git a/docs/contracts/abstract-contracts.rst b/docs/contracts/abstract-contracts.rst index 87340733d..924805467 100644 --- a/docs/contracts/abstract-contracts.rst +++ b/docs/contracts/abstract-contracts.rst @@ -8,7 +8,7 @@ Abstract Contracts Contracts are marked as abstract when at least one of their functions lacks an implementation as in the following example (note that the function declaration header is terminated by ``;``):: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract Feline { function utterance() public returns (bytes32); @@ -16,7 +16,7 @@ Contracts are marked as abstract when at least one of their functions lacks an i Such contracts cannot be compiled (even if they contain implemented functions alongside non-implemented functions), but they can be used as base contracts:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract Feline { function utterance() public returns (bytes32); diff --git a/docs/contracts/constant-state-variables.rst b/docs/contracts/constant-state-variables.rst index 3e615ed01..2b4b7ff5b 100644 --- a/docs/contracts/constant-state-variables.rst +++ b/docs/contracts/constant-state-variables.rst @@ -26,7 +26,7 @@ value types and strings. :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract C { uint constant x = 32**22 + 8; diff --git a/docs/contracts/creating-contracts.rst b/docs/contracts/creating-contracts.rst index 981243b12..8b7784c36 100644 --- a/docs/contracts/creating-contracts.rst +++ b/docs/contracts/creating-contracts.rst @@ -33,7 +33,7 @@ This means that cyclic creation dependencies are impossible. :: - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.7.0; contract OwnedToken { // `TokenCreator` is a contract type that is defined below. diff --git a/docs/contracts/events.rst b/docs/contracts/events.rst index ecb0a87f8..d97f2dd25 100644 --- a/docs/contracts/events.rst +++ b/docs/contracts/events.rst @@ -63,7 +63,7 @@ not possible to filter for specific anonymous events by name. :: - pragma solidity >=0.4.21 <0.6.0; + pragma solidity >=0.4.21 <0.7.0; contract ClientReceipt { event Deposit( @@ -136,7 +136,7 @@ as topics. The event call above can be performed in the same way as :: - pragma solidity >=0.4.10 <0.6.0; + pragma solidity >=0.4.10 <0.7.0; contract C { function f() public payable { diff --git a/docs/contracts/function-modifiers.rst b/docs/contracts/function-modifiers.rst index 376cd9fa1..fd24a8cb5 100644 --- a/docs/contracts/function-modifiers.rst +++ b/docs/contracts/function-modifiers.rst @@ -12,7 +12,7 @@ inheritable properties of contracts and may be overridden by derived contracts. :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract owned { constructor() public { owner = msg.sender; } diff --git a/docs/contracts/functions.rst b/docs/contracts/functions.rst index 522ce5c47..4e5a52c0f 100644 --- a/docs/contracts/functions.rst +++ b/docs/contracts/functions.rst @@ -23,7 +23,7 @@ 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:: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract Simple { uint sum; @@ -55,7 +55,7 @@ Function return variables are declared with the same syntax after the 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:: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract Simple { function arithmetic(uint _a, uint _b) @@ -78,7 +78,7 @@ or you can provide return values (either a single or :ref:`multiple ones`) directly with the ``return`` statement:: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract Simple { function arithmetic(uint _a, uint _b) @@ -140,7 +140,7 @@ The following statements are considered modifying the state: :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract C { function f(uint a, uint b) public view returns (uint) { @@ -185,7 +185,7 @@ In addition to the list of state modifying statements explained above, the follo :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract C { function f(uint a, uint b) public pure returns (uint) { @@ -279,7 +279,7 @@ Like any function, the fallback function can execute complex operations as long :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract Test { // This function is called for all messages sent to @@ -330,7 +330,7 @@ The following example shows overloading of the function :: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract A { function f(uint _in) public pure returns (uint out) { @@ -348,7 +348,7 @@ externally visible functions differ by their Solidity types but not by their ext :: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; // This will not compile contract A { @@ -381,7 +381,7 @@ candidate, resolution fails. :: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract A { function f(uint8 _in) public pure returns (uint8 out) { diff --git a/docs/contracts/inheritance.rst b/docs/contracts/inheritance.rst index 2e94c2f9d..0474a2b5c 100644 --- a/docs/contracts/inheritance.rst +++ b/docs/contracts/inheritance.rst @@ -23,7 +23,7 @@ Details are given in the following example. :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract owned { constructor() public { owner = msg.sender; } @@ -95,7 +95,7 @@ Note that above, we call ``mortal.kill()`` to "forward" the destruction request. The way this is done is problematic, as seen in the following example:: - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.7.0; contract owned { constructor() public { owner = msg.sender; } @@ -124,7 +124,7 @@ derived override, but this function will bypass ``Base1.kill``, basically because it does not even know about ``Base1``. The way around this is to use ``super``:: - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.7.0; contract owned { constructor() public { owner = msg.sender; } @@ -188,7 +188,7 @@ equivalent to ``constructor() public {}``. For example: :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract A { uint public a; @@ -218,7 +218,7 @@ 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:: - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.7.0; contract Base { uint x; @@ -277,7 +277,7 @@ error "Linearization of inheritance graph impossible". :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract X {} contract A is X {} diff --git a/docs/contracts/interfaces.rst b/docs/contracts/interfaces.rst index b551b5184..43c8637ee 100644 --- a/docs/contracts/interfaces.rst +++ b/docs/contracts/interfaces.rst @@ -22,7 +22,7 @@ Interfaces are denoted by their own keyword: :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; interface Token { enum TokenType { Fungible, NonFungible } diff --git a/docs/contracts/libraries.rst b/docs/contracts/libraries.rst index 0cabe18ac..eaa69100c 100644 --- a/docs/contracts/libraries.rst +++ b/docs/contracts/libraries.rst @@ -47,7 +47,7 @@ more advanced example to implement a set). :: - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.7.0; library Set { // We define a new struct datatype that will be used to @@ -121,7 +121,7 @@ custom types without the overhead of external function calls: :: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; library BigInt { struct bigint { diff --git a/docs/contracts/using-for.rst b/docs/contracts/using-for.rst index ef456ff42..12fc976d5 100644 --- a/docs/contracts/using-for.rst +++ b/docs/contracts/using-for.rst @@ -31,7 +31,7 @@ available without having to add further code. Let us rewrite the set example from the :ref:`libraries` in this way:: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; // This is the same code as before, just without comments library Set { @@ -81,7 +81,7 @@ Let us rewrite the set example from the It is also possible to extend elementary types in that way:: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; library Search { function indexOf(uint[] storage self, uint value) diff --git a/docs/contracts/visibility-and-getters.rst b/docs/contracts/visibility-and-getters.rst index e78c96741..e2a10122c 100644 --- a/docs/contracts/visibility-and-getters.rst +++ b/docs/contracts/visibility-and-getters.rst @@ -53,7 +53,7 @@ return parameter list for functions. :: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract C { function f(uint a) private pure returns (uint b) { return a + 1; } @@ -67,7 +67,7 @@ In the following example, ``D``, can call ``c.getData()`` to retrieve the value :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract C { uint private data; @@ -111,7 +111,7 @@ when they are declared. :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract C { uint public data = 42; @@ -131,7 +131,7 @@ it evaluates to a state variable. If it is accessed externally :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract C { uint public data; @@ -150,7 +150,7 @@ to write a function, for example: :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract arrayExample { // public state variable @@ -176,7 +176,7 @@ The next example is more complex: :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract Complex { struct Data { diff --git a/docs/contributing.rst b/docs/contributing.rst index 5e9308b50..80ccdfda1 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -404,4 +404,4 @@ Common Terms Code Examples ------------- -* 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.6.0;``. \ No newline at end of file +* 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;``. \ No newline at end of file diff --git a/docs/control-structures.rst b/docs/control-structures.rst index 6e3c64d50..fa59a4adf 100644 --- a/docs/control-structures.rst +++ b/docs/control-structures.rst @@ -37,7 +37,7 @@ Internal Function Calls Functions of the current contract can be called directly ("internally"), also recursively, as seen in this nonsensical example:: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract C { function g(uint a) public pure returns (uint ret) { return a + f(); } @@ -75,7 +75,7 @@ When calling functions of other contracts, you can specify the amount of Wei or :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract InfoFeed { function info() public payable returns (uint ret) { return 42; } @@ -122,7 +122,7 @@ parameters from the function declaration, but can be in arbitrary order. :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract C { mapping(uint => uint) data; @@ -145,7 +145,7 @@ Those parameters will still be present on the stack, but they are inaccessible. :: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract C { // omitted name for parameter @@ -168,7 +168,7 @@ is compiled so recursive creation-dependencies are not possible. :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract D { uint public x; @@ -225,7 +225,7 @@ groupings of expressions. :: - pragma solidity >0.4.23 <0.6.0; + pragma solidity >0.4.23 <0.7.0; contract C { uint[] data; @@ -270,7 +270,7 @@ because only a reference and not a copy is passed. :: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract C { uint[20] x; @@ -316,7 +316,7 @@ the two variables have the same name but disjoint scopes. :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract C { function minimalScoping() pure public { { @@ -337,7 +337,7 @@ In any case, you will get a warning about the outer variable being shadowed. :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; // This will report a warning contract C { function f() pure public returns (uint) { @@ -357,7 +357,7 @@ In any case, you will get a warning about the outer variable being shadowed. :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; // This will not compile contract C { function f() pure public returns (uint) { @@ -404,7 +404,7 @@ a message string for ``require``, but not for ``assert``. :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract Sharer { function sendHalf(address payable addr) public payable returns (uint balance) { @@ -450,7 +450,7 @@ The following example shows how an error string can be used together with revert :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract VendingMachine { function buy(uint amount) public payable { diff --git a/docs/examples/blind-auction.rst b/docs/examples/blind-auction.rst index 70d95ad6d..0b13621ec 100644 --- a/docs/examples/blind-auction.rst +++ b/docs/examples/blind-auction.rst @@ -30,7 +30,7 @@ activate themselves. :: - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.7.0; contract SimpleAuction { // Parameters of the auction. Times are either @@ -194,7 +194,7 @@ high or low invalid bids. :: - pragma solidity >0.4.23 <0.6.0; + pragma solidity >0.4.23 <0.7.0; contract BlindAuction { struct Bid { diff --git a/docs/examples/micropayment.rst b/docs/examples/micropayment.rst index e06ea4a4f..c7f4a9925 100644 --- a/docs/examples/micropayment.rst +++ b/docs/examples/micropayment.rst @@ -112,7 +112,7 @@ The full contract :: - pragma solidity >=0.4.24 <0.6.0; + pragma solidity >=0.4.24 <0.7.0; contract ReceiverPays { address owner = msg.sender; @@ -286,7 +286,7 @@ The full contract :: - pragma solidity >=0.4.24 <0.6.0; + pragma solidity >=0.4.24 <0.7.0; contract SimplePaymentChannel { address payable public sender; // The account sending payments. diff --git a/docs/examples/modular.rst b/docs/examples/modular.rst index b9bd92d9c..ebde40592 100644 --- a/docs/examples/modular.rst +++ b/docs/examples/modular.rst @@ -11,7 +11,7 @@ addresses match what you expect. :: - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.7.0; library Balances { function move(mapping(address => uint256) storage balances, address from, address to, uint amount) internal { diff --git a/docs/examples/safe-remote.rst b/docs/examples/safe-remote.rst index cfc63a240..765bdfc35 100644 --- a/docs/examples/safe-remote.rst +++ b/docs/examples/safe-remote.rst @@ -6,7 +6,7 @@ Safe Remote Purchase :: - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.7.0; contract Purchase { uint public value; diff --git a/docs/examples/voting.rst b/docs/examples/voting.rst index 73ace87d9..e4b6da200 100644 --- a/docs/examples/voting.rst +++ b/docs/examples/voting.rst @@ -32,7 +32,7 @@ of votes. :: - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.7.0; /// @title Voting with delegation. contract Ballot { diff --git a/docs/introduction-to-smart-contracts.rst b/docs/introduction-to-smart-contracts.rst index 0cce690b3..15d5ad6c4 100644 --- a/docs/introduction-to-smart-contracts.rst +++ b/docs/introduction-to-smart-contracts.rst @@ -17,7 +17,7 @@ Storage :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract SimpleStorage { uint storedData; @@ -81,7 +81,7 @@ registering with username and password — all you need is an Ethereum keypair. :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; contract Coin { // The keyword "public" makes those variables diff --git a/docs/layout-of-source-files.rst b/docs/layout-of-source-files.rst index 235f4dd4f..b2fa3f94e 100644 --- a/docs/layout-of-source-files.rst +++ b/docs/layout-of-source-files.rst @@ -280,7 +280,7 @@ for the two function parameters and two return variables. :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; /** @title Shape calculator. */ contract ShapeCalculator { diff --git a/docs/miscellaneous.rst b/docs/miscellaneous.rst index a57aa2884..048283e8d 100644 --- a/docs/miscellaneous.rst +++ b/docs/miscellaneous.rst @@ -62,7 +62,7 @@ non-elementary type, the positions are found by adding an offset of ``keccak256( So for the following contract snippet:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract C { struct s { uint a; uint b; } diff --git a/docs/security-considerations.rst b/docs/security-considerations.rst index ebc39ad0c..c3b04f08f 100644 --- a/docs/security-considerations.rst +++ b/docs/security-considerations.rst @@ -55,7 +55,7 @@ complete contract): :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; // THIS CONTRACT CONTAINS A BUG - DO NOT USE contract Fund { @@ -78,7 +78,7 @@ as it uses ``call`` which forwards all remaining gas by default: :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; // THIS CONTRACT CONTAINS A BUG - DO NOT USE contract Fund { @@ -97,7 +97,7 @@ outlined further below: :: - pragma solidity >=0.4.11 <0.6.0; + pragma solidity >=0.4.11 <0.7.0; contract Fund { /// Mapping of ether shares of the contract. @@ -183,7 +183,7 @@ Never use tx.origin for authorization. Let's say you have a wallet contract like :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; // THIS CONTRACT CONTAINS A BUG - DO NOT USE contract TxUserWallet { @@ -203,7 +203,7 @@ Now someone tricks you into sending ether to the address of this attack wallet: :: - pragma solidity ^0.5.0; + pragma solidity >=0.5.0 <0.7.0; interface TxUserWallet { function transferTo(address payable dest, uint amount) external; diff --git a/docs/structure-of-a-contract.rst b/docs/structure-of-a-contract.rst index 569639e0b..01ed23233 100644 --- a/docs/structure-of-a-contract.rst +++ b/docs/structure-of-a-contract.rst @@ -26,7 +26,7 @@ storage. :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract SimpleStorage { uint storedData; // State variable @@ -46,7 +46,7 @@ Functions are the executable units of code within a contract. :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract SimpleAuction { function bid() public payable { // Function @@ -69,7 +69,7 @@ Function modifiers can be used to amend the semantics of functions in a declarat :: - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.7.0; contract Purchase { address public seller; @@ -96,7 +96,7 @@ Events are convenience interfaces with the EVM logging facilities. :: - pragma solidity >=0.4.21 <0.6.0; + pragma solidity >=0.4.21 <0.7.0; contract SimpleAuction { event HighestBidIncreased(address bidder, uint amount); // Event @@ -120,7 +120,7 @@ Structs are custom defined types that can group several variables (see :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract Ballot { struct Voter { // Struct @@ -141,7 +141,7 @@ Enums can be used to create custom types with a finite set of 'constant values' :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract Purchase { enum State { Created, Locked, Inactive } // Enum diff --git a/docs/style-guide.rst b/docs/style-guide.rst index dcbfc486a..d754f1ce7 100644 --- a/docs/style-guide.rst +++ b/docs/style-guide.rst @@ -52,7 +52,7 @@ Surround top level declarations in solidity source with two blank lines. Yes:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract A { // ... @@ -70,7 +70,7 @@ Yes:: No:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract A { // ... @@ -89,7 +89,7 @@ Blank lines may be omitted between groups of related one-liners (such as stub fu Yes:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract A { function spam() public pure; @@ -109,7 +109,7 @@ Yes:: No:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract A { function spam() public pure { @@ -237,7 +237,7 @@ Import statements should always be placed at the top of the file. Yes:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; import "./Owned.sol"; @@ -251,7 +251,7 @@ Yes:: No:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract A { // ... @@ -283,7 +283,7 @@ Within a grouping, place the ``view`` and ``pure`` functions last. Yes:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract A { constructor() public { @@ -315,7 +315,7 @@ Yes:: No:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract A { @@ -411,7 +411,7 @@ should: Yes:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract Coin { struct Bank { @@ -422,7 +422,7 @@ Yes:: No:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract Coin { @@ -723,7 +723,7 @@ manner as modifiers if the function declaration is long or hard to read. Yes:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; // Base contracts just to make this compile contract B { @@ -755,7 +755,7 @@ Yes:: No:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; // Base contracts just to make this compile contract B { @@ -971,7 +971,7 @@ As shown in the example below, if the contract name is `Congress` and the librar Yes:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; // Owned.sol contract Owned { @@ -1000,7 +1000,7 @@ Yes:: No:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; // owned.sol contract owned { @@ -1104,7 +1104,7 @@ multiline comment starting with `/**` and ending with `*/`. For example, the contract from `a simple smart contract `_ with the comments added looks like the one below:: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; /// @author The Solidity Team /// @title A simple storage example diff --git a/docs/types/mapping-types.rst b/docs/types/mapping-types.rst index 935ed6b4f..2414687c5 100644 --- a/docs/types/mapping-types.rst +++ b/docs/types/mapping-types.rst @@ -34,7 +34,7 @@ each ``_KeyType``, recursively. For example with a mapping: :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract MappingExample { mapping(address => uint) public balances; diff --git a/docs/types/operators.rst b/docs/types/operators.rst index 9851f2145..f0915e2df 100644 --- a/docs/types/operators.rst +++ b/docs/types/operators.rst @@ -27,7 +27,7 @@ value it referred to previously. :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract DeleteExample { uint data; diff --git a/docs/types/reference-types.rst b/docs/types/reference-types.rst index c640ca22d..6a4f6e64c 100644 --- a/docs/types/reference-types.rst +++ b/docs/types/reference-types.rst @@ -49,7 +49,7 @@ Data locations are not only relevant for persistency of data, but also for the s :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; contract C { uint[] x; // the data location of x is storage @@ -146,7 +146,7 @@ or create a new memory array and copy every element. :: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract C { function f(uint len) public pure { @@ -175,7 +175,7 @@ In the example below, the type of ``[1, 2, 3]`` is :: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract C { function f() public pure { @@ -190,7 +190,7 @@ Fixed size memory arrays cannot be assigned to dynamically-sized memory arrays, :: - pragma solidity >=0.4.0 <0.6.0; + pragma solidity >=0.4.0 <0.7.0; // This will not compile. contract C { @@ -248,7 +248,7 @@ Array Members :: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract ArrayContract { uint[2**20] m_aLotOfIntegers; @@ -347,7 +347,7 @@ shown in the following example: :: - pragma solidity >=0.4.11 <0.6.0; + pragma solidity >=0.4.11 <0.7.0; contract CrowdFunding { // Defines a new type with two fields. diff --git a/docs/types/value-types.rst b/docs/types/value-types.rst index 039e605e2..ac20b49a3 100644 --- a/docs/types/value-types.rst +++ b/docs/types/value-types.rst @@ -517,7 +517,7 @@ subsequent unsigned integer values starting from ``0``. :: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract test { enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill } @@ -621,7 +621,7 @@ Public (or external) functions have the following members: Example that shows how to use the members:: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; contract Example { function f() public payable returns (bytes4) { @@ -634,7 +634,7 @@ Example that shows how to use the members:: Example that shows how to use internal function types:: - pragma solidity >=0.4.16 <0.6.0; + pragma solidity >=0.4.16 <0.7.0; library ArrayUtils { // internal functions can be used in internal library functions because @@ -685,7 +685,7 @@ Example that shows how to use internal function types:: Another example that uses external function types:: - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.7.0; contract Oracle { struct Request {