diff options
author | chriseth <chris@ethereum.org> | 2018-06-05 01:33:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-05 01:33:54 +0800 |
commit | c2e4c4651a725a55f9ab0995fdebd25165a656f3 (patch) | |
tree | 7470275b038a66a44121e7b49dc261d741f2f1a2 /docs/contracts.rst | |
parent | d0049489299d1d2437be6531998aaab2838874ce (diff) | |
parent | 1a603625d49d615b883118b083b1b962ba7e64f7 (diff) | |
download | dexon-solidity-c2e4c4651a725a55f9ab0995fdebd25165a656f3.tar.gz dexon-solidity-c2e4c4651a725a55f9ab0995fdebd25165a656f3.tar.zst dexon-solidity-c2e4c4651a725a55f9ab0995fdebd25165a656f3.zip |
Merge pull request #4216 from kronosapiens/patch-2
Update function visibility example
Diffstat (limited to 'docs/contracts.rst')
-rw-r--r-- | docs/contracts.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst index fde5d642..e4f49f43 100644 --- a/docs/contracts.rst +++ b/docs/contracts.rst @@ -194,10 +194,10 @@ In the following example, ``D``, can call ``c.getData()`` to retrieve the value contract C { uint private data; - function f(uint a) private returns(uint b) { return a + 1; } + function f(uint a) private pure returns(uint b) { return a + 1; } function setData(uint a) public { data = a; } - function getData() public returns(uint) { return data; } - function compute(uint a, uint b) internal returns (uint) { return a+b; } + function getData() public view returns(uint) { return data; } + function compute(uint a, uint b) internal pure returns (uint) { return a + b; } } contract D { |