aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-11-04 17:55:03 +0800
committerGitHub <noreply@github.com>2016-11-04 17:55:03 +0800
commitd97d267a96b973104e9d29bed3e6cedcd223a96b (patch)
treeb36ddadd9cd0cd1412be91f95cfdd07286d4e535
parent5d19727c2fc6956e68fc266874fa2a02d627c4f4 (diff)
parent364698255aef1638e8d3e917dfc5a577312e6d07 (diff)
downloaddexon-solidity-d97d267a96b973104e9d29bed3e6cedcd223a96b.tar
dexon-solidity-d97d267a96b973104e9d29bed3e6cedcd223a96b.tar.gz
dexon-solidity-d97d267a96b973104e9d29bed3e6cedcd223a96b.tar.bz2
dexon-solidity-d97d267a96b973104e9d29bed3e6cedcd223a96b.tar.lz
dexon-solidity-d97d267a96b973104e9d29bed3e6cedcd223a96b.tar.xz
dexon-solidity-d97d267a96b973104e9d29bed3e6cedcd223a96b.tar.zst
dexon-solidity-d97d267a96b973104e9d29bed3e6cedcd223a96b.zip
Merge pull request #1323 from varunagarwal315/patch-1
Update solidity-by-example.rst
-rw-r--r--docs/solidity-by-example.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/solidity-by-example.rst b/docs/solidity-by-example.rst
index 2e53b78c..915cfa76 100644
--- a/docs/solidity-by-example.rst
+++ b/docs/solidity-by-example.rst
@@ -170,6 +170,15 @@ of votes.
}
}
}
+
+ // Calls winningProposal() function to get the index
+ // of the winner contained in the proposals array and then
+ // returns the name of the winner
+ function winnerName() constant
+ returns (bytes32 winnerName)
+ {
+ winnerName = proposals[winningProposal()].name;
+ }
}
Possible Improvements