mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add license tags to documentation snippets.
This commit is contained in:
@@ -41,6 +41,7 @@ Internal Function Calls
|
||||
Functions of the current contract can be called directly ("internally"), also recursively, as seen in
|
||||
this nonsensical example::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.4.22 <0.7.0;
|
||||
|
||||
contract C {
|
||||
@@ -82,6 +83,7 @@ to the total balance of that contract:
|
||||
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.6.2 <0.7.0;
|
||||
|
||||
contract InfoFeed {
|
||||
@@ -137,6 +139,7 @@ parameters from the function declaration, but can be in arbitrary order.
|
||||
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.4.0 <0.7.0;
|
||||
|
||||
contract C {
|
||||
@@ -160,6 +163,7 @@ Those parameters will still be present on the stack, but they are inaccessible.
|
||||
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.4.22 <0.7.0;
|
||||
|
||||
contract C {
|
||||
@@ -183,6 +187,7 @@ is compiled so recursive creation-dependencies are not possible.
|
||||
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.6.2 <0.7.0;
|
||||
|
||||
contract D {
|
||||
@@ -238,6 +243,7 @@ which only need to be created if there is a dispute.
|
||||
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.6.2 <0.7.0;
|
||||
|
||||
contract D {
|
||||
@@ -307,6 +313,7 @@ groupings of expressions.
|
||||
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.5.0 <0.7.0;
|
||||
|
||||
contract C {
|
||||
@@ -352,6 +359,7 @@ because only a reference and not a copy is passed.
|
||||
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.4.22 <0.7.0;
|
||||
|
||||
contract C {
|
||||
@@ -410,6 +418,7 @@ the two variables have the same name but disjoint scopes.
|
||||
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.5.0 <0.7.0;
|
||||
contract C {
|
||||
function minimalScoping() pure public {
|
||||
@@ -431,6 +440,7 @@ In any case, you will get a warning about the outer variable being shadowed.
|
||||
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.5.0 <0.7.0;
|
||||
// This will report a warning
|
||||
contract C {
|
||||
@@ -452,6 +462,7 @@ In any case, you will get a warning about the outer variable being shadowed.
|
||||
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.5.0 <0.7.0;
|
||||
// This will not compile
|
||||
contract C {
|
||||
@@ -540,6 +551,7 @@ and ``assert`` for internal error checking.
|
||||
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.5.0 <0.7.0;
|
||||
|
||||
contract Sharer {
|
||||
@@ -584,6 +596,7 @@ The following example shows how to use an error string together with ``revert``
|
||||
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.5.0 <0.7.0;
|
||||
|
||||
contract VendingMachine {
|
||||
@@ -627,6 +640,7 @@ A failure in an external call can be caught using a try/catch statement, as foll
|
||||
|
||||
::
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity ^0.6.0;
|
||||
|
||||
interface DataFeed { function getData(address token) external returns (uint value); }
|
||||
|
||||
Reference in New Issue
Block a user