mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Docs: change >0.6.99 <0.8.0 to >=0.7.0
This commit is contained in:
parent
f7233f15eb
commit
710231e2b1
@ -537,7 +537,7 @@ For example,
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
|
||||
contract Test {
|
||||
|
@ -140,7 +140,7 @@ Local Solidity variables are available for assignments, for example:
|
||||
.. code::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract C {
|
||||
uint b;
|
||||
|
@ -28,7 +28,7 @@ you receive the funds of the person who is now the richest.
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract WithdrawalContract {
|
||||
address public richest;
|
||||
@ -62,7 +62,7 @@ This is as opposed to the more intuitive sending pattern:
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract SendContract {
|
||||
address payable public richest;
|
||||
|
@ -26,7 +26,7 @@ Not all types for constants and immutables are implemented at this time. The onl
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract C {
|
||||
uint constant X = 32**22 + 8;
|
||||
|
@ -39,7 +39,7 @@ Details are given in the following example.
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
|
||||
contract Owned {
|
||||
@ -127,7 +127,7 @@ destruction request. The way this is done is problematic, as
|
||||
seen in the following example::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract owned {
|
||||
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``::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract owned {
|
||||
constructor() { owner = msg.sender; }
|
||||
@ -214,7 +214,7 @@ The following example demonstrates changing mutability and visibility:
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract Base
|
||||
{
|
||||
@ -405,7 +405,7 @@ equivalent to ``constructor() {}``. For example:
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
abstract contract 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::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract Base {
|
||||
uint x;
|
||||
@ -523,7 +523,7 @@ One area where inheritance linearization is especially important and perhaps not
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract Base1 {
|
||||
constructor() {}
|
||||
|
@ -192,7 +192,7 @@ is compiled so recursive creation-dependencies are not possible.
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract D {
|
||||
uint public x;
|
||||
@ -248,7 +248,7 @@ which only need to be created if there is a dispute.
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract D {
|
||||
uint public x;
|
||||
|
@ -25,7 +25,7 @@ to receive their money - contracts cannot activate themselves.
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract SimpleAuction {
|
||||
// Parameters of the auction. Times are either
|
||||
@ -186,7 +186,7 @@ invalid bids.
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract BlindAuction {
|
||||
struct Bid {
|
||||
|
@ -142,7 +142,7 @@ The full contract
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract ReceiverPays {
|
||||
address owner = msg.sender;
|
||||
@ -339,7 +339,7 @@ The full contract
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract SimplePaymentChannel {
|
||||
address payable public sender; // The account sending payments.
|
||||
|
@ -26,7 +26,7 @@ you can use state machine-like constructs inside a contract.
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract Purchase {
|
||||
uint public value;
|
||||
@ -143,4 +143,4 @@ you can use state machine-like constructs inside a contract.
|
||||
|
||||
seller.transfer(3 * value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ of votes.
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
/// @title Voting with delegation.
|
||||
contract Ballot {
|
||||
|
@ -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
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
// THIS CONTRACT CONTAINS A BUG - DO NOT USE
|
||||
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
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
interface TxUserWallet {
|
||||
function transferTo(address payable dest, uint amount) external;
|
||||
|
@ -300,7 +300,7 @@ Within a grouping, place the ``view`` and ``pure`` functions last.
|
||||
Yes::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract A {
|
||||
constructor() {
|
||||
@ -337,7 +337,7 @@ Yes::
|
||||
No::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract A {
|
||||
|
||||
@ -758,7 +758,7 @@ manner as modifiers if the function declaration is long or hard to read.
|
||||
Yes::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
// Base contracts just to make this compile
|
||||
contract B {
|
||||
@ -790,7 +790,7 @@ Yes::
|
||||
No::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
|
||||
// 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::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
|
||||
// Owned.sol
|
||||
@ -1048,7 +1048,7 @@ and in ``Congress.sol``::
|
||||
No::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
|
||||
// owned.sol
|
||||
|
@ -434,7 +434,7 @@ Array slices are useful to ABI-decode secondary data passed in function paramete
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
|
||||
contract Proxy {
|
||||
/// @dev Address of the client contract managed by proxy i.e., this contract
|
||||
|
@ -693,7 +693,7 @@ have to be updated manually.)
|
||||
|
||||
.. code-block:: Solidity
|
||||
|
||||
pragma solidity >0.6.99 <0.8.0;
|
||||
pragma solidity >=0.7.0;
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
abstract contract C {
|
||||
// FIXME: remove constructor visibility and make the contract abstract
|
||||
|
Loading…
Reference in New Issue
Block a user