diff --git a/CMakeLists.txt b/CMakeLists.txt index fb8c1a49c..1bb982ab8 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.6.1") +set(PROJECT_VERSION "0.7.0") project(solidity VERSION ${PROJECT_VERSION} LANGUAGES C CXX) include(TestBigEndian) diff --git a/Changelog.md b/Changelog.md index 9b4d81ff7..77faf6504 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,15 @@ +### 0.7.0 (unreleased) + +Language Features: + + +Compiler Features: + + +Bugfixes: + + + ### 0.6.1 (unreleased) Language Features: diff --git a/README.md b/README.md index 4729c95c0..8eef61b82 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ found in the [Solidity documentation](https://solidity.readthedocs.io/en/latest/ A "Hello World" program in Solidity is of even less use than in other languages, but still: ```solidity -pragma solidity ^0.6.0; +pragma solidity >=0.6.0 <0.8.0; contract HelloWorld { function helloWorld() external pure returns (string memory) { diff --git a/docs/050-breaking-changes.rst b/docs/050-breaking-changes.rst index 497936f31..383d2440e 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 <0.7.0; + pragma solidity >=0.5.0 <0.8.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 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; interface OldContract { function someOldFunction(uint8 a) external; @@ -431,7 +431,7 @@ New version: :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract OtherContract { uint x; diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst index a3bd78319..f4bfc6b70 100644 --- a/docs/abi-spec.rst +++ b/docs/abi-spec.rst @@ -232,7 +232,7 @@ Given the contract: :: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; contract Foo { @@ -532,7 +532,7 @@ For example, :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract Test { @@ -580,7 +580,7 @@ As an example, the code :: - pragma solidity >=0.4.19 <0.7.0; + pragma solidity >=0.4.19 <0.8.0; pragma experimental ABIEncoderV2; diff --git a/docs/assembly.rst b/docs/assembly.rst index 2bc89ad57..632a892d1 100644 --- a/docs/assembly.rst +++ b/docs/assembly.rst @@ -72,7 +72,7 @@ without a compiler change. .. code:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; library GetCode { function at(address _addr) public view returns (bytes memory o_code) { @@ -97,7 +97,7 @@ efficient code, for example: .. code:: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; library VectorSum { @@ -385,7 +385,7 @@ Local Solidity variables are available for assignments, for example: .. code:: - pragma solidity >=0.4.11 <0.7.0; + pragma solidity >=0.4.11 <0.8.0; contract C { uint b; @@ -425,7 +425,7 @@ declaration visible in the scope of the inline assembly block. .. code:: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; contract C { function f(uint x) public view returns (uint b) { @@ -689,7 +689,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.7.0; + pragma solidity >=0.4.16 <0.8.0; contract C { diff --git a/docs/common-patterns.rst b/docs/common-patterns.rst index ab25cb4b9..9c0a0dbc3 100644 --- a/docs/common-patterns.rst +++ b/docs/common-patterns.rst @@ -27,7 +27,7 @@ you receive the funds of the person who is now the richest. :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract WithdrawalContract { address public richest; @@ -60,7 +60,7 @@ This is as opposed to the more intuitive sending pattern: :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract SendContract { address payable public richest; @@ -121,7 +121,7 @@ restrictions highly readable. :: - pragma solidity >=0.4.22 <0.7.0; + pragma solidity >=0.4.22 <0.8.0; contract AccessRestriction { // These will be assigned at the construction @@ -273,7 +273,7 @@ function finishes. :: - pragma solidity >=0.4.22 <0.7.0; + pragma solidity >=0.4.22 <0.8.0; contract StateMachine { enum Stages { diff --git a/docs/contracts/abstract-contracts.rst b/docs/contracts/abstract-contracts.rst index 51db0dfbe..b23cc9e8c 100644 --- a/docs/contracts/abstract-contracts.rst +++ b/docs/contracts/abstract-contracts.rst @@ -13,7 +13,7 @@ This can be done by using the ``abstract`` keyword as shown in the following exa defined as abstract, because the function ``utterance()`` was defined, but no implementation was provided (no implementation body ``{ }`` was given).:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; abstract contract Feline { function utterance() public virtual returns (bytes32); @@ -22,7 +22,7 @@ provided (no implementation body ``{ }`` was given).:: Such abstract contracts can not be instantiated directly. This is also true, if an abstract contract itself does implement all defined functions. The usage of an abstract contract as a base class is shown in the following example:: - pragma solidity ^0.6.0; + pragma solidity >=0.6.0 <0.8.0; abstract contract Feline { function utterance() public virtual returns (bytes32); diff --git a/docs/contracts/constant-state-variables.rst b/docs/contracts/constant-state-variables.rst index 2b4b7ff5b..5a50ee6e6 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.7.0; + pragma solidity >=0.4.0 <0.8.0; contract C { uint constant x = 32**22 + 8; diff --git a/docs/contracts/creating-contracts.rst b/docs/contracts/creating-contracts.rst index 90578f784..504acb9cb 100644 --- a/docs/contracts/creating-contracts.rst +++ b/docs/contracts/creating-contracts.rst @@ -34,7 +34,7 @@ This means that cyclic creation dependencies are impossible. :: - pragma solidity >=0.4.22 <0.7.0; + pragma solidity >=0.4.22 <0.8.0; contract OwnedToken { diff --git a/docs/contracts/events.rst b/docs/contracts/events.rst index 46b426d8e..b2e3c72d0 100644 --- a/docs/contracts/events.rst +++ b/docs/contracts/events.rst @@ -65,7 +65,7 @@ is that they are cheaper to deploy and call. :: - pragma solidity >=0.4.21 <0.7.0; + pragma solidity >=0.4.21 <0.8.0; contract ClientReceipt { event Deposit( @@ -138,7 +138,7 @@ as topics. The event call above can be performed in the same way as :: - pragma solidity >=0.4.10 <0.7.0; + pragma solidity >=0.4.10 <0.8.0; contract C { function f() public payable { diff --git a/docs/contracts/function-modifiers.rst b/docs/contracts/function-modifiers.rst index ad2804302..26082226b 100644 --- a/docs/contracts/function-modifiers.rst +++ b/docs/contracts/function-modifiers.rst @@ -17,7 +17,7 @@ if they are marked ``virtual``. For details, please see :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract owned { constructor() public { owner = msg.sender; } diff --git a/docs/contracts/functions.rst b/docs/contracts/functions.rst index 717961b7c..7b04285b7 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 the following:: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.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.7.0; + pragma solidity >=0.4.16 <0.8.0; contract Simple { function arithmetic(uint _a, uint _b) @@ -79,7 +79,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.7.0; + pragma solidity >=0.4.16 <0.8.0; contract Simple { function arithmetic(uint _a, uint _b) @@ -142,7 +142,7 @@ The following statements are considered modifying the state: :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract C { function f(uint a, uint b) public view returns (uint) { @@ -187,7 +187,7 @@ In addition to the list of state modifying statements explained above, the follo :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract C { function f(uint a, uint b) public pure returns (uint) { @@ -280,7 +280,7 @@ Below you can see an example of a Sink contract that uses function ``receive``. :: - pragma solidity ^0.6.0; + pragma solidity >=0.6.0 <0.8.0; // This contract keeps all Ether sent to it with no way // to get it back. @@ -335,7 +335,7 @@ operations as long as there is enough gas passed on to it. :: - pragma solidity ^0.6.0; + pragma solidity >=0.6.0 <0.8.0; contract Test { // This function is called for all messages sent to @@ -407,7 +407,7 @@ The following example shows overloading of the function :: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; contract A { function f(uint _in) public pure returns (uint out) { @@ -425,7 +425,7 @@ externally visible functions differ by their Solidity types but not by their ext :: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; // This will not compile contract A { @@ -458,7 +458,7 @@ candidate, resolution fails. :: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.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 ee766e474..6d4ae725f 100644 --- a/docs/contracts/inheritance.rst +++ b/docs/contracts/inheritance.rst @@ -38,7 +38,7 @@ Details are given in the following example. :: - pragma solidity ^0.6.0; + pragma solidity >=0.6.0 <0.8.0; contract Owned { @@ -125,7 +125,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.6.0; + pragma solidity >=0.6.0 <0.8.0; contract owned { constructor() public { owner = msg.sender; } @@ -154,7 +154,7 @@ A call to ``Final.kill()`` will call ``Base2.kill`` because we specify it explicitly in the final override, but this function will bypass ``Base1.kill``. The way around this is to use ``super``:: - pragma solidity >=0.4.22 <0.7.0; + pragma solidity >=0.4.22 <0.8.0; contract owned { constructor() public { owner = msg.sender; } @@ -204,7 +204,7 @@ use the ``override`` keyword in the function header as shown in this example: :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract Base { @@ -227,7 +227,7 @@ bases, it has to explicitly override it: :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract Base1 { @@ -253,7 +253,7 @@ that already overrides all other functions. :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract A { function f() public pure{} } contract B is A {} @@ -293,7 +293,7 @@ of the variable: :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract A { @@ -324,7 +324,7 @@ and the ``override`` keyword must be used in the overriding modifier: :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract Base { @@ -342,7 +342,7 @@ explicitly: :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract Base1 { @@ -389,7 +389,7 @@ equivalent to ``constructor() public {}``. For example: :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract A { uint public a; @@ -419,7 +419,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.7.0; + pragma solidity >=0.4.22 <0.8.0; contract Base { uint x; @@ -478,7 +478,7 @@ error "Linearization of inheritance graph impossible". :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract X {} contract A is X {} @@ -498,7 +498,7 @@ One area where inheritance linearization is especially important and perhaps not :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract Base1 { constructor() public {} diff --git a/docs/contracts/interfaces.rst b/docs/contracts/interfaces.rst index 69d4917cc..8c4fb25e0 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 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; interface Token { enum TokenType { Fungible, NonFungible } diff --git a/docs/contracts/libraries.rst b/docs/contracts/libraries.rst index 803e53f08..f1d48855f 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.7.0; + pragma solidity >=0.4.22 <0.8.0; // We define a new struct datatype that will be used to @@ -123,7 +123,7 @@ custom types without the overhead of external function calls: :: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; struct bigint { uint[] limbs; @@ -237,7 +237,7 @@ Its value can be obtained from Solidity using the ``.selector`` member as follow :: - pragma solidity >0.5.13 <0.7.0; + pragma solidity >0.5.13 <0.8.0; library L { function f(uint256) external {} diff --git a/docs/contracts/using-for.rst b/docs/contracts/using-for.rst index 32aa71799..151ad3b72 100644 --- a/docs/contracts/using-for.rst +++ b/docs/contracts/using-for.rst @@ -29,7 +29,7 @@ may only be used inside a contract, not inside any of its functions. Let us rewrite the set example from the :ref:`libraries` in this way:: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; // This is the same code as before, just without comments @@ -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.7.0; + pragma solidity >=0.4.16 <0.8.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 3a0905155..bf37bc5da 100644 --- a/docs/contracts/visibility-and-getters.rst +++ b/docs/contracts/visibility-and-getters.rst @@ -54,7 +54,7 @@ return parameter list for functions. :: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; contract C { function f(uint a) private pure returns (uint b) { return a + 1; } @@ -68,7 +68,7 @@ In the following example, ``D``, can call ``c.getData()`` to retrieve the value :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract C { uint private data; @@ -112,7 +112,7 @@ when they are declared. :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract C { uint public data = 42; @@ -132,7 +132,7 @@ it evaluates to a state variable. If it is accessed externally :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract C { uint public data; @@ -151,7 +151,7 @@ to write a function, for example: :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract arrayExample { // public state variable @@ -177,7 +177,7 @@ The next example is more complex: :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract Complex { struct Data { diff --git a/docs/contributing.rst b/docs/contributing.rst index 1b50ccaaa..735e52e4f 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -422,7 +422,7 @@ or ``interface`` using the ``./test/cmdlineTests.sh`` script when you create a P ensure they work and pass tests before creating the PR. Ensure that all code examples begin with a ``pragma`` version that spans the largest where the contract code is valid. -For example ``pragma solidity >=0.4.0 <0.7.0;``. +For example ``pragma solidity >=0.4.0 <0.8.0;``. Running Documentation Tests --------------------------- diff --git a/docs/control-structures.rst b/docs/control-structures.rst index d962a4e26..31df68767 100644 --- a/docs/control-structures.rst +++ b/docs/control-structures.rst @@ -41,7 +41,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.7.0; + pragma solidity >=0.4.16 <0.8.0; contract C { function g(uint a) public pure returns (uint ret) { return a + f(); } @@ -81,7 +81,7 @@ of the contract: :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract InfoFeed { function info() public payable returns (uint ret) { return 42; } @@ -131,7 +131,7 @@ parameters from the function declaration, but can be in arbitrary order. :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract C { mapping(uint => uint) data; @@ -154,7 +154,7 @@ Those parameters will still be present on the stack, but they are inaccessible. :: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; contract C { // omitted name for parameter @@ -177,7 +177,7 @@ is compiled so recursive creation-dependencies are not possible. :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract D { uint public x; @@ -237,7 +237,7 @@ groupings of expressions. :: - pragma solidity >0.4.23 <0.7.0; + pragma solidity >0.4.23 <0.8.0; contract C { uint index; @@ -292,7 +292,7 @@ because only a reference and not a copy is passed. :: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; contract C { uint[20] x; @@ -350,7 +350,7 @@ the two variables have the same name but disjoint scopes. :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract C { function minimalScoping() pure public { { @@ -371,7 +371,7 @@ In any case, you will get a warning about the outer variable being shadowed. :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; // This will report a warning contract C { function f() pure public returns (uint) { @@ -392,7 +392,7 @@ In any case, you will get a warning about the outer variable being shadowed. :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; // This will not compile contract C { function f() pure public returns (uint) { @@ -480,7 +480,7 @@ and ``assert`` for internal error checking. :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract Sharer { function sendHalf(address payable addr) public payable returns (uint balance) { @@ -524,7 +524,7 @@ The following example shows how to use an error string together with ``revert`` :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract VendingMachine { function buy(uint amount) public payable { @@ -567,7 +567,7 @@ A failure in an external call can be caught using a try/catch statement, as foll :: - pragma solidity ^0.6.0; + pragma solidity >=0.6.0 <0.8.0; interface DataFeed { function getData(address token) external returns (uint value); } diff --git a/docs/examples/blind-auction.rst b/docs/examples/blind-auction.rst index 92a755973..185b1a342 100644 --- a/docs/examples/blind-auction.rst +++ b/docs/examples/blind-auction.rst @@ -24,7 +24,7 @@ to receive their money - contracts cannot activate themselves. :: - pragma solidity >=0.4.22 <0.7.0; + pragma solidity >=0.4.22 <0.8.0; contract SimpleAuction { // Parameters of the auction. Times are either @@ -184,7 +184,7 @@ invalid bids. :: - pragma solidity >0.4.23 <0.7.0; + pragma solidity >0.4.23 <0.8.0; contract BlindAuction { struct Bid { diff --git a/docs/examples/micropayment.rst b/docs/examples/micropayment.rst index f675586dd..f6e8e02c1 100644 --- a/docs/examples/micropayment.rst +++ b/docs/examples/micropayment.rst @@ -142,7 +142,7 @@ The full contract :: - pragma solidity >=0.4.24 <0.7.0; + pragma solidity >=0.4.24 <0.8.0; contract ReceiverPays { address owner = msg.sender; @@ -338,7 +338,7 @@ The full contract :: - pragma solidity >=0.4.24 <0.7.0; + pragma solidity >=0.4.24 <0.8.0; contract SimplePaymentChannel { address payable public sender; // The account sending payments. diff --git a/docs/examples/modular.rst b/docs/examples/modular.rst index a3d932b09..0e2dcb106 100644 --- a/docs/examples/modular.rst +++ b/docs/examples/modular.rst @@ -19,7 +19,7 @@ and the sum of all balances is an invariant across the lifetime of the contract. :: - pragma solidity >=0.4.22 <0.7.0; + pragma solidity >=0.4.22 <0.8.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 d79c6526e..84a7aace4 100644 --- a/docs/examples/safe-remote.rst +++ b/docs/examples/safe-remote.rst @@ -25,7 +25,7 @@ you can use state machine-like constructs inside a contract. :: - pragma solidity >=0.4.22 <0.7.0; + pragma solidity >=0.4.22 <0.8.0; contract Purchase { uint public value; diff --git a/docs/examples/voting.rst b/docs/examples/voting.rst index e4b6da200..0859d290e 100644 --- a/docs/examples/voting.rst +++ b/docs/examples/voting.rst @@ -32,7 +32,7 @@ of votes. :: - pragma solidity >=0.4.22 <0.7.0; + pragma solidity >=0.4.22 <0.8.0; /// @title Voting with delegation. contract Ballot { diff --git a/docs/introduction-to-smart-contracts.rst b/docs/introduction-to-smart-contracts.rst index fada5d291..1f337bae6 100644 --- a/docs/introduction-to-smart-contracts.rst +++ b/docs/introduction-to-smart-contracts.rst @@ -17,7 +17,7 @@ Storage Example :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract SimpleStorage { uint storedData; @@ -77,7 +77,7 @@ registering with a username and password, all you need is an Ethereum keypair. :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract Coin { // The keyword "public" makes variables diff --git a/docs/layout-of-source-files.rst b/docs/layout-of-source-files.rst index 1fec22aec..dc9bc8287 100644 --- a/docs/layout-of-source-files.rst +++ b/docs/layout-of-source-files.rst @@ -284,7 +284,7 @@ for the two function parameters and two return variables. :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; /** @title Shape calculator. */ contract ShapeCalculator { diff --git a/docs/miscellaneous.rst b/docs/miscellaneous.rst index 085bf99e7..09978023c 100644 --- a/docs/miscellaneous.rst +++ b/docs/miscellaneous.rst @@ -75,7 +75,7 @@ So for the following contract snippet the position of ``data[4][9].b`` is at ``keccak256(uint256(9) . keccak256(uint256(4) . uint256(1))) + 1``:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract C { @@ -175,7 +175,7 @@ value and reference types, types that are encoded packed, and nested types. .. code:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract A { struct S { uint128 a; diff --git a/docs/natspec-format.rst b/docs/natspec-format.rst index ae429580a..6f241eda3 100644 --- a/docs/natspec-format.rst +++ b/docs/natspec-format.rst @@ -49,7 +49,7 @@ The following example shows a contract and a function using all available tags. .. code:: solidity - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; /// @title A simulator for trees /// @author Larry A. Gardner diff --git a/docs/security-considerations.rst b/docs/security-considerations.rst index 96187403b..c18163184 100644 --- a/docs/security-considerations.rst +++ b/docs/security-considerations.rst @@ -58,7 +58,7 @@ complete contract): :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; // THIS CONTRACT CONTAINS A BUG - DO NOT USE contract Fund { @@ -81,7 +81,7 @@ as it uses ``call`` which forwards all remaining gas by default: :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; // THIS CONTRACT CONTAINS A BUG - DO NOT USE contract Fund { @@ -100,7 +100,7 @@ outlined further below: :: - pragma solidity >=0.4.11 <0.7.0; + pragma solidity >=0.4.11 <0.8.0; contract Fund { /// Mapping of ether shares of the contract. @@ -197,7 +197,7 @@ Never use tx.origin for authorization. Let's say you have a wallet contract like :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; // THIS CONTRACT CONTAINS A BUG - DO NOT USE contract TxUserWallet { @@ -217,7 +217,7 @@ Now someone tricks you into sending Ether to the address of this attack wallet: :: - pragma solidity ^0.6.0; + pragma solidity >=0.6.0 <0.8.0; interface TxUserWallet { function transferTo(address payable dest, uint amount) external; @@ -277,7 +277,7 @@ field of a ``struct`` that is the base type of a dynamic storage array. The :: - pragma solidity >=0.5.0 <0.7.0; + pragma solidity >=0.5.0 <0.8.0; contract Map { mapping (uint => uint)[] array; diff --git a/docs/structure-of-a-contract.rst b/docs/structure-of-a-contract.rst index b6d70c5a3..e2b43239b 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.7.0; + pragma solidity >=0.4.0 <0.8.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.7.0; + pragma solidity >=0.4.0 <0.8.0; contract SimpleAuction { function bid() public payable { // Function @@ -74,7 +74,7 @@ Like functions, modifiers can be :ref:`overridden `. :: - pragma solidity >=0.4.22 <0.7.0; + pragma solidity >=0.4.22 <0.8.0; contract Purchase { address public seller; @@ -101,7 +101,7 @@ Events are convenience interfaces with the EVM logging facilities. :: - pragma solidity >=0.4.21 <0.7.0; + pragma solidity >=0.4.21 <0.8.0; contract SimpleAuction { event HighestBidIncreased(address bidder, uint amount); // Event @@ -125,7 +125,7 @@ Structs are custom defined types that can group several variables (see :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract Ballot { struct Voter { // Struct @@ -146,7 +146,7 @@ Enums can be used to create custom types with a finite set of 'constant values' :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract Purchase { enum State { Created, Locked, Inactive } // Enum diff --git a/docs/style-guide.rst b/docs/style-guide.rst index 84602542f..840e2b331 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.7.0; + pragma solidity >=0.4.0 <0.8.0; contract A { // ... @@ -70,7 +70,7 @@ Yes:: No:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.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.6.0; + pragma solidity >=0.6.0 <0.8.0; abstract contract A { function spam() public virtual pure; @@ -109,7 +109,7 @@ Yes:: No:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; abstract contract A { function spam() virtual pure public; @@ -243,7 +243,7 @@ Import statements should always be placed at the top of the file. Yes:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; import "./Owned.sol"; @@ -257,7 +257,7 @@ Yes:: No:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract A { // ... @@ -290,7 +290,7 @@ Within a grouping, place the ``view`` and ``pure`` functions last. Yes:: - pragma solidity ^0.6.0; + pragma solidity >=0.6.0 <0.8.0; contract A { constructor() public { @@ -326,7 +326,7 @@ Yes:: No:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract A { @@ -434,7 +434,7 @@ should: Yes:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract Coin { struct Bank { @@ -445,7 +445,7 @@ Yes:: No:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract Coin { @@ -745,7 +745,7 @@ manner as modifiers if the function declaration is long or hard to read. Yes:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; // Base contracts just to make this compile contract B { @@ -777,7 +777,7 @@ Yes:: No:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; // Base contracts just to make this compile @@ -1000,7 +1000,7 @@ As shown in the example below, if the contract name is `Congress` and the librar Yes:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; // Owned.sol @@ -1023,7 +1023,7 @@ Yes:: and in ``Congress.sol``:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; import "./Owned.sol"; @@ -1034,7 +1034,7 @@ and in ``Congress.sol``:: No:: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; // owned.sol @@ -1138,7 +1138,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.7.0; + pragma solidity >=0.4.0 <0.8.0; /// @author The Solidity Team diff --git a/docs/types/mapping-types.rst b/docs/types/mapping-types.rst index 5b41d4bd0..e77dc4911 100644 --- a/docs/types/mapping-types.rst +++ b/docs/types/mapping-types.rst @@ -42,7 +42,7 @@ contract that returns the value at the specified address. :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract MappingExample { mapping(address => uint) public balances; @@ -67,7 +67,7 @@ The example below uses ``_allowances`` to record the amount someone else is allo :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract MappingExample { @@ -121,7 +121,7 @@ the ``sum`` function iterates over to sum all the values. :: - pragma solidity >=0.5.99 <0.7.0; + pragma solidity >=0.5.99 <0.8.0; struct IndexValue { uint keyIndex; uint value; } struct KeyFlag { uint key; bool deleted; } diff --git a/docs/types/operators.rst b/docs/types/operators.rst index c65e545c5..753a42bf5 100644 --- a/docs/types/operators.rst +++ b/docs/types/operators.rst @@ -42,7 +42,7 @@ value it referred to previously. :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract DeleteExample { uint data; diff --git a/docs/types/reference-types.rst b/docs/types/reference-types.rst index 15cd110dd..ce9ef9b3a 100644 --- a/docs/types/reference-types.rst +++ b/docs/types/reference-types.rst @@ -57,7 +57,7 @@ Data locations are not only relevant for persistency of data, but also for the s :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; contract C { // The data location of x is storage. @@ -161,7 +161,7 @@ or create a new memory array and copy every element. :: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; contract C { function f(uint len) public pure { @@ -192,7 +192,7 @@ the first element to ``uint``. :: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; contract C { function f() public pure { @@ -208,7 +208,7 @@ memory arrays, i.e. the following is not possible: :: - pragma solidity >=0.4.0 <0.7.0; + pragma solidity >=0.4.0 <0.8.0; // This will not compile. contract C { @@ -268,7 +268,7 @@ Array Members :: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; contract ArrayContract { uint[2**20] m_aLotOfIntegers; @@ -400,7 +400,7 @@ Array slices are useful to ABI-decode secondary data passed in function paramete :: - pragma solidity >=0.4.99 <0.7.0; + pragma solidity >=0.4.99 <0.8.0; contract Proxy { /// Address of the client contract managed by proxy i.e., this contract @@ -437,7 +437,7 @@ shown in the following example: :: - pragma solidity >=0.4.11 <0.7.0; + pragma solidity >=0.4.11 <0.8.0; // Defines a new type with two fields. // Declaring a struct outside of a contract allows diff --git a/docs/types/value-types.rst b/docs/types/value-types.rst index be7ca1d6e..627dc2502 100644 --- a/docs/types/value-types.rst +++ b/docs/types/value-types.rst @@ -534,7 +534,7 @@ subsequent unsigned integer values starting from ``0``. :: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; contract test { enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill } @@ -640,7 +640,7 @@ External (or public) functions have the following members: Example that shows how to use the members:: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; contract Example { @@ -656,7 +656,7 @@ Example that shows how to use the members:: Example that shows how to use internal function types:: - pragma solidity >=0.4.16 <0.7.0; + pragma solidity >=0.4.16 <0.8.0; library ArrayUtils { @@ -714,7 +714,7 @@ Example that shows how to use internal function types:: Another example that uses external function types:: - pragma solidity >=0.4.22 <0.7.0; + pragma solidity >=0.4.22 <0.8.0; contract Oracle { diff --git a/test/contracts/AuctionRegistrar.cpp b/test/contracts/AuctionRegistrar.cpp index ffe1c3495..4459b3e67 100644 --- a/test/contracts/AuctionRegistrar.cpp +++ b/test/contracts/AuctionRegistrar.cpp @@ -42,7 +42,7 @@ namespace { static char const* registrarCode = R"DELIMITER( -pragma solidity >=0.4.0 <0.7.0; +pragma solidity >=0.4.0 <0.8.0; abstract contract NameRegister { function addr(string memory _name) public virtual view returns (address o_owner); diff --git a/test/contracts/FixedFeeRegistrar.cpp b/test/contracts/FixedFeeRegistrar.cpp index acc51c2b9..658f41fbd 100644 --- a/test/contracts/FixedFeeRegistrar.cpp +++ b/test/contracts/FixedFeeRegistrar.cpp @@ -53,7 +53,7 @@ static char const* registrarCode = R"DELIMITER( // @authors: // Gav Wood -pragma solidity >=0.4.0 <0.7.0; +pragma solidity >=0.4.0 <0.8.0; abstract contract Registrar { event Changed(string indexed name); diff --git a/test/contracts/Wallet.cpp b/test/contracts/Wallet.cpp index 25b81d4d9..01e07482c 100644 --- a/test/contracts/Wallet.cpp +++ b/test/contracts/Wallet.cpp @@ -56,7 +56,7 @@ static char const* walletCode = R"DELIMITER( // some number (specified in constructor) of the set of owners (specified in the constructor, modifiable) before the // interior is executed. -pragma solidity >=0.4.0 <0.7.0; +pragma solidity >=0.4.0 <0.8.0; contract multiowned { diff --git a/test/libsolidity/GasCosts.cpp b/test/libsolidity/GasCosts.cpp index de90c9076..1e1edb7c6 100644 --- a/test/libsolidity/GasCosts.cpp +++ b/test/libsolidity/GasCosts.cpp @@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE(string_storage) auto evmVersion = dev::test::Options::get().evmVersion(); if (evmVersion <= EVMVersion::byzantium()) - CHECK_DEPLOY_GAS(134209, 130895, evmVersion); + CHECK_DEPLOY_GAS(134145, 130831, evmVersion); // This is only correct on >=Constantinople. else if (Options::get().useABIEncoderV2) { @@ -107,22 +107,22 @@ BOOST_AUTO_TEST_CASE(string_storage) { // Costs with 0 are cases which cannot be triggered in tests. if (evmVersion < EVMVersion::istanbul()) - CHECK_DEPLOY_GAS(0, 124033, evmVersion); + CHECK_DEPLOY_GAS(0, 123969, evmVersion); else - CHECK_DEPLOY_GAS(0, 110981, evmVersion); + CHECK_DEPLOY_GAS(0, 110969, evmVersion); } else { if (evmVersion < EVMVersion::istanbul()) - CHECK_DEPLOY_GAS(147835, 131687, evmVersion); + CHECK_DEPLOY_GAS(147835, 123969, evmVersion); else - CHECK_DEPLOY_GAS(131871, 117231, evmVersion); + CHECK_DEPLOY_GAS(131871, 110969, evmVersion); } } else if (evmVersion < EVMVersion::istanbul()) - CHECK_DEPLOY_GAS(126993, 119723, evmVersion); + CHECK_DEPLOY_GAS(126929, 119659, evmVersion); else - CHECK_DEPLOY_GAS(114357, 107347, evmVersion); + CHECK_DEPLOY_GAS(114345, 107335, evmVersion); if (evmVersion >= EVMVersion::byzantium()) { @@ -142,9 +142,9 @@ BOOST_AUTO_TEST_CASE(string_storage) else { if (evmVersion < EVMVersion::istanbul()) - CHECK_GAS(21707, 21635, 20); + CHECK_GAS(21707, 21559, 20); else - CHECK_GAS(21499, 21431, 20); + CHECK_GAS(21499, 21351, 20); } } else if (evmVersion < EVMVersion::istanbul()) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 72772f048..c1ed1d67e 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -14319,8 +14319,6 @@ BOOST_AUTO_TEST_CASE(event_wrong_abi_name) )"; compileAndRun(sourceCode, 0, "ClientReceipt", bytes()); compileAndRun(sourceCode, 0, "Test", bytes(), map{{"ClientReceipt", m_contractAddress}}); - u256 value(18); - u256 id(0x1234); callContractFunction("f()"); BOOST_REQUIRE_EQUAL(numLogs(), 1); diff --git a/test/libsolidity/semanticTests/uninitializedFunctionPointer/store2.sol b/test/libsolidity/semanticTests/uninitializedFunctionPointer/store2.sol index 527ec52c1..835156567 100644 --- a/test/libsolidity/semanticTests/uninitializedFunctionPointer/store2.sol +++ b/test/libsolidity/semanticTests/uninitializedFunctionPointer/store2.sol @@ -1,4 +1,4 @@ -pragma solidity >=0.5.7 <0.7.0; +pragma solidity >=0.4.0 <0.8.0; contract InvalidTest { diff --git a/test/libsolidity/semanticTests/viaYul/erc20.sol b/test/libsolidity/semanticTests/viaYul/erc20.sol index 6b524e0bf..2ba09521c 100644 --- a/test/libsolidity/semanticTests/viaYul/erc20.sol +++ b/test/libsolidity/semanticTests/viaYul/erc20.sol @@ -1,4 +1,4 @@ -pragma solidity >=0.4.0 <0.7.0; +pragma solidity >=0.4.0 <0.8.0; contract ERC20 { event Transfer(address indexed from, address indexed to, uint256 value);