aboutsummaryrefslogtreecommitdiffstats
path: root/docs/solidity-by-example.rst
diff options
context:
space:
mode:
authorChim Kan <designium@gmail.com>2017-08-24 08:25:12 +0800
committerGitHub <noreply@github.com>2017-08-24 08:25:12 +0800
commitb5d2a4ecd7ed971a962bac1d61b5d3ffca824084 (patch)
treef8bbb6818de247615926776bab2f8499b2830c09 /docs/solidity-by-example.rst
parent957f23a9f4cb181b2dfaf0170816080513bfe786 (diff)
downloaddexon-solidity-b5d2a4ecd7ed971a962bac1d61b5d3ffca824084.tar.gz
dexon-solidity-b5d2a4ecd7ed971a962bac1d61b5d3ffca824084.tar.zst
dexon-solidity-b5d2a4ecd7ed971a962bac1d61b5d3ffca824084.zip
Adding storage into the pointer for Voter delegate
Hi, The example from https://github.com/ethereum/solidity/blob/develop/docs/solidity-by-example.rst is not working. It keeps giving this error in the Mist program: Could not compile source code. Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning. Voter delegate = voters[to]; ^------------^ The solution is just to add the keyword "storage" and then the example works again.
Diffstat (limited to 'docs/solidity-by-example.rst')
-rw-r--r--docs/solidity-by-example.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/solidity-by-example.rst b/docs/solidity-by-example.rst
index dde4495b..88eaadd5 100644
--- a/docs/solidity-by-example.rst
+++ b/docs/solidity-by-example.rst
@@ -126,7 +126,7 @@ of votes.
// modifies `voters[msg.sender].voted`
sender.voted = true;
sender.delegate = to;
- Voter delegate = voters[to];
+ Voter storage delegate = voters[to];
if (delegate.voted) {
// If the delegate already voted,
// directly add to the number of votes