Merge pull request #11159 from ethereum/custom-natspec-example

Adds @custom:.... natspec example to the natspec-format documentation.
This commit is contained in:
Alex Beregszaszi 2021-03-25 12:53:17 +00:00 committed by GitHub
commit 18e6d1c3b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,12 +60,13 @@ The following example shows a contract and a function using all available tags.
.. code:: Solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.6.12 <0.9.0;
pragma solidity >=0.8.2 < 0.9.0;
/// @title A simulator for trees
/// @author Larry A. Gardner
/// @notice You can use this contract for only the most basic simulation
/// @dev All function calls are currently implemented without side effects
/// @custom:experimental This is an experimental contract.
contract Tree {
/// @notice Calculate tree age in years, rounded up, for live trees
/// @dev The Alexandr N. Tetearing algorithm could increase precision
@ -236,6 +237,7 @@ file should also be produced and should look like this:
"kind" : "dev",
"author" : "Larry A. Gardner",
"details" : "All function calls are currently implemented without side effects",
"custom:experimental": "This is an experimental contract.",
"methods" :
{
"age(uint256)" :