diff options
author | Jim McDonald <Jim@mcdee.net> | 2017-12-13 02:47:30 +0800 |
---|---|---|
committer | Jim McDonald <Jim@mcdee.net> | 2017-12-13 02:47:30 +0800 |
commit | 6e521d59b0a30fa0673aaf84559d5b74dbb1eed7 (patch) | |
tree | 618b00999c2de8432f222c7b990f51ef4de6b1f0 /docs/introduction-to-smart-contracts.rst | |
parent | 7614b16dc9b2bb1e267e8f46834b40220fb9f9fb (diff) | |
download | dexon-solidity-6e521d59b0a30fa0673aaf84559d5b74dbb1eed7.tar.gz dexon-solidity-6e521d59b0a30fa0673aaf84559d5b74dbb1eed7.tar.zst dexon-solidity-6e521d59b0a30fa0673aaf84559d5b74dbb1eed7.zip |
Fix Solidity warnings
Diffstat (limited to 'docs/introduction-to-smart-contracts.rst')
-rw-r--r-- | docs/introduction-to-smart-contracts.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/introduction-to-smart-contracts.rst b/docs/introduction-to-smart-contracts.rst index aedc0c09..6425dcaa 100644 --- a/docs/introduction-to-smart-contracts.rst +++ b/docs/introduction-to-smart-contracts.rst @@ -21,11 +21,11 @@ Storage contract SimpleStorage { uint storedData; - function set(uint x) { + function set(uint x) public { storedData = x; } - function get() constant returns (uint) { + function get() public constant returns (uint) { return storedData; } } @@ -94,16 +94,16 @@ registering with username and password - all you need is an Ethereum keypair. // This is the constructor whose code is // run only when the contract is created. - function Coin() { + function Coin() public { minter = msg.sender; } - function mint(address receiver, uint amount) { + function mint(address receiver, uint amount) public { if (msg.sender != minter) return; balances[receiver] += amount; } - function send(address receiver, uint amount) { + function send(address receiver, uint amount) public { if (balances[msg.sender] < amount) return; balances[msg.sender] -= amount; balances[receiver] += amount; @@ -145,7 +145,7 @@ like this one. The :ref:`getter function<getter-functions>` created by the ``pub is a bit more complex in this case. It roughly looks like the following:: - function balances(address _account) returns (uint) { + function balances(address _account) public view returns (uint) { return balances[_account]; } |