Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
8a3d6b4b
Commit
8a3d6b4b
authored
Nov 27, 2014
by
Christian
Committed by
chriseth
Jul 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make use of msg.sender.
parent
5c07958e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
index.html
index.html
+4
-4
No files found.
index.html
View file @
8a3d6b4b
...
...
@@ -49,7 +49,7 @@ Source code on the left, compiled code and AST on the right (or error).
<div
id=
"input"
>
contract Ballot {
// Create a new ballot with $(_numProposals) different proposals.
function Ballot(uint8 _numProposals) {
address sender =
0x123; // msg.sender
address sender =
msg.sender;
chairperson = sender;
numProposals = _numProposals;
}
...
...
@@ -57,13 +57,13 @@ Source code on the left, compiled code and AST on the right (or error).
// Give $(voter) the right to vote on this ballot.
// May only be called by $(chairperson).
function giveRightToVote(address voter) {
if (
/*msg.sender != chairperson ||*/
voted[voter]) return;
if (
msg.sender != chairperson ||
voted[voter]) return;
voterWeight[voter] = 1;
}
// Delegate your vote to the voter $(to).
function delegate(address to) {
address sender =
0x123; // msg.sender
address sender =
msg.sender;
if (voted[sender]) return;
while (delegations[to] != address(0)
&&
delegations[to] != sender)
to = delegations[to];
...
...
@@ -76,7 +76,7 @@ Source code on the left, compiled code and AST on the right (or error).
// Give a single vote to proposal $(proposal).
function vote(uint8 proposal) {
address sender =
0x123; // msg.sender
address sender =
msg.sender;
if (voted[sender] || proposal >= numProposals) return;
voted[sender] = true;
votes[sender] = proposal;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment