diff options
author | chriseth <chris@ethereum.org> | 2016-08-08 21:49:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-08 21:49:37 +0800 |
commit | 2fcc6ec335f12def973aadd0e5a9fd6d4a2935e1 (patch) | |
tree | fc828218f5c51e3f28e2553e1bf18c8b21daaa9a /docs/layout-of-source-files.rst | |
parent | b13e581397d135e362bf0289e7cb6c0e56877957 (diff) | |
parent | 6846bb5dfde9d554e67b8b315188ffdf2871740c (diff) | |
download | dexon-solidity-2fcc6ec335f12def973aadd0e5a9fd6d4a2935e1.tar dexon-solidity-2fcc6ec335f12def973aadd0e5a9fd6d4a2935e1.tar.gz dexon-solidity-2fcc6ec335f12def973aadd0e5a9fd6d4a2935e1.tar.bz2 dexon-solidity-2fcc6ec335f12def973aadd0e5a9fd6d4a2935e1.tar.lz dexon-solidity-2fcc6ec335f12def973aadd0e5a9fd6d4a2935e1.tar.xz dexon-solidity-2fcc6ec335f12def973aadd0e5a9fd6d4a2935e1.tar.zst dexon-solidity-2fcc6ec335f12def973aadd0e5a9fd6d4a2935e1.zip |
Merge pull request #820 from mocamircea/patch-3
Update layout-of-source-files.rst
Diffstat (limited to 'docs/layout-of-source-files.rst')
-rw-r--r-- | docs/layout-of-source-files.rst | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/layout-of-source-files.rst b/docs/layout-of-source-files.rst index aa6278ba..ef6fd656 100644 --- a/docs/layout-of-source-files.rst +++ b/docs/layout-of-source-files.rst @@ -157,3 +157,23 @@ You can use Doxygen-style tags inside these comments to document functions, annotate conditions for formal verification, and provide a **confirmation text** which is shown to users when they attempt to invoke a function. + +In the following example we document the title of the contract, the explanation +for the two input parameters and two returned values. + +:: + + /** @title Shape calculator.*/ + contract shapeCalculator{ + /**@dev Calculates a rectangle's surface and perimeter. + * @param w Width of the rectangle. + * @param h Height of the rectangle. + * @return s The calculated surface. + * @return p The calculated perimeter. + */ + function rectangle(uint w, uint h) returns (uint s, uint p){ + s = w*h; + p = 2*(w+h); + } + } + |