[DOCS] Change >=0.7.0 to ^0.7.0

This commit is contained in:
Harikrishnan Mulackal 2020-09-28 13:02:20 +02:00
parent 9115100f2a
commit 8339765509
14 changed files with 30 additions and 30 deletions

View File

@ -537,7 +537,7 @@ For example,
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract Test { contract Test {

View File

@ -140,7 +140,7 @@ Local Solidity variables are available for assignments, for example:
.. code:: .. code::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract C { contract C {
uint b; uint b;

View File

@ -28,7 +28,7 @@ you receive the funds of the person who is now the richest.
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract WithdrawalContract { contract WithdrawalContract {
address public richest; address public richest;
@ -62,7 +62,7 @@ This is as opposed to the more intuitive sending pattern:
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract SendContract { contract SendContract {
address payable public richest; address payable public richest;

View File

@ -26,7 +26,7 @@ Not all types for constants and immutables are implemented at this time. The onl
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract C { contract C {
uint constant X = 32**22 + 8; uint constant X = 32**22 + 8;

View File

@ -39,7 +39,7 @@ Details are given in the following example.
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract Owned { contract Owned {
@ -127,7 +127,7 @@ destruction request. The way this is done is problematic, as
seen in the following example:: seen in the following example::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract owned { contract owned {
constructor() { owner = msg.sender; } constructor() { owner = msg.sender; }
@ -157,7 +157,7 @@ explicitly in the final override, but this function will bypass
``Base1.destroy``. The way around this is to use ``super``:: ``Base1.destroy``. The way around this is to use ``super``::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract owned { contract owned {
constructor() { owner = msg.sender; } constructor() { owner = msg.sender; }
@ -214,7 +214,7 @@ The following example demonstrates changing mutability and visibility:
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract Base contract Base
{ {
@ -405,7 +405,7 @@ equivalent to ``constructor() {}``. For example:
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
abstract contract A { abstract contract A {
uint public a; uint public a;
@ -442,7 +442,7 @@ 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:: derived contracts need to specify all of them. This can be done in two ways::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract Base { contract Base {
uint x; uint x;
@ -523,7 +523,7 @@ One area where inheritance linearization is especially important and perhaps not
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract Base1 { contract Base1 {
constructor() {} constructor() {}

View File

@ -192,7 +192,7 @@ is compiled so recursive creation-dependencies are not possible.
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract D { contract D {
uint public x; uint public x;
@ -248,7 +248,7 @@ which only need to be created if there is a dispute.
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract D { contract D {
uint public x; uint public x;

View File

@ -25,7 +25,7 @@ to receive their money - contracts cannot activate themselves.
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract SimpleAuction { contract SimpleAuction {
// Parameters of the auction. Times are either // Parameters of the auction. Times are either
@ -186,7 +186,7 @@ invalid bids.
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract BlindAuction { contract BlindAuction {
struct Bid { struct Bid {

View File

@ -142,7 +142,7 @@ The full contract
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract ReceiverPays { contract ReceiverPays {
address owner = msg.sender; address owner = msg.sender;
@ -339,7 +339,7 @@ The full contract
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract SimplePaymentChannel { contract SimplePaymentChannel {
address payable public sender; // The account sending payments. address payable public sender; // The account sending payments.

View File

@ -26,7 +26,7 @@ you can use state machine-like constructs inside a contract.
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract Purchase { contract Purchase {
uint public value; uint public value;

View File

@ -33,7 +33,7 @@ of votes.
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
/// @title Voting with delegation. /// @title Voting with delegation.
contract Ballot { contract Ballot {

View File

@ -201,7 +201,7 @@ Never use tx.origin for authorization. Let's say you have a wallet contract like
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
// THIS CONTRACT CONTAINS A BUG - DO NOT USE // THIS CONTRACT CONTAINS A BUG - DO NOT USE
contract TxUserWallet { contract TxUserWallet {
@ -222,7 +222,7 @@ Now someone tricks you into sending Ether to the address of this attack wallet:
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
interface TxUserWallet { interface TxUserWallet {
function transferTo(address payable dest, uint amount) external; function transferTo(address payable dest, uint amount) external;

View File

@ -300,7 +300,7 @@ Within a grouping, place the ``view`` and ``pure`` functions last.
Yes:: Yes::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract A { contract A {
constructor() { constructor() {
@ -337,7 +337,7 @@ Yes::
No:: No::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract A { contract A {
@ -758,7 +758,7 @@ manner as modifiers if the function declaration is long or hard to read.
Yes:: Yes::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
// Base contracts just to make this compile // Base contracts just to make this compile
contract B { contract B {
@ -790,7 +790,7 @@ Yes::
No:: No::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
// Base contracts just to make this compile // Base contracts just to make this compile
@ -1012,7 +1012,7 @@ As shown in the example below, if the contract name is ``Congress`` and the libr
Yes:: Yes::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
// Owned.sol // Owned.sol
@ -1048,7 +1048,7 @@ and in ``Congress.sol``::
No:: No::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
// owned.sol // owned.sol

View File

@ -434,7 +434,7 @@ Array slices are useful to ABI-decode secondary data passed in function paramete
:: ::
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
contract Proxy { contract Proxy {
/// @dev Address of the client contract managed by proxy i.e., this contract /// @dev Address of the client contract managed by proxy i.e., this contract

View File

@ -693,7 +693,7 @@ have to be updated manually.)
.. code-block:: Solidity .. code-block:: Solidity
pragma solidity >=0.7.0; pragma solidity ^0.7.0;
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
abstract contract C { abstract contract C {
// FIXME: remove constructor visibility and make the contract abstract // FIXME: remove constructor visibility and make the contract abstract