Skip to content

Commit 336460d

Browse files
authored
Merge pull request #232 from ethereum/event-emit
Update DAO contracts (use emit for events)
2 parents a35eb7b + f1a7d2a commit 336460d

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

test/DAO/DAO.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
467467

468468
sumOfProposalDeposits += msg.value;
469469

470-
ProposalAdded(
470+
emit ProposalAdded(
471471
_proposalID,
472472
_recipient,
473473
_amount,
@@ -517,7 +517,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
517517
blocked[msg.sender] = _proposalID;
518518
}
519519

520-
Voted(_proposalID, _supportsProposal, msg.sender);
520+
emit Voted(_proposalID, _supportsProposal, msg.sender);
521521
}
522522

523523

@@ -610,7 +610,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
610610
closeProposal(_proposalID);
611611

612612
// Initiate event
613-
ProposalTallied(_proposalID, _success, quorum);
613+
emit ProposalTallied(_proposalID, _success, quorum);
614614
}
615615

616616

@@ -835,7 +835,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
835835
if (msg.sender != curator)
836836
revert();
837837
allowedRecipients[_recipient] = _allowed;
838-
AllowedRecipientChanged(_recipient, _allowed);
838+
emit AllowedRecipientChanged(_recipient, _allowed);
839839
return true;
840840
}
841841

@@ -880,7 +880,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
880880
}
881881

882882
function createNewDAO(address _newCurator) internal returns (DAO _newDAO) {
883-
NewCurator(_newCurator);
883+
emit NewCurator(_newCurator);
884884
return daoCreator.createDAO(
885885
_newCurator,
886886
0,

test/DAO/ManagedAccount.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ contract ManagedAccount is ManagedAccountInterface{
5858
if (msg.sender != owner || msg.value > 0 || (payOwnerOnly && _recipient != owner))
5959
revert();
6060
if (_recipient.call.value(_amount)("")) {
61-
PayOut(_recipient, _amount);
61+
emit PayOut(_recipient, _amount);
6262
return true;
6363
} else {
6464
return false;

test/DAO/Token.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ contract Token is TokenInterface {
104104
if (balances[msg.sender] >= _amount && _amount > 0) {
105105
balances[msg.sender] -= _amount;
106106
balances[_to] += _amount;
107-
Transfer(msg.sender, _to, _amount);
107+
emit Transfer(msg.sender, _to, _amount);
108108
return true;
109109
} else {
110110
return false;
@@ -124,7 +124,7 @@ contract Token is TokenInterface {
124124
balances[_to] += _amount;
125125
balances[_from] -= _amount;
126126
allowed[_from][msg.sender] -= _amount;
127-
Transfer(_from, _to, _amount);
127+
emit Transfer(_from, _to, _amount);
128128
return true;
129129
} else {
130130
return false;
@@ -133,7 +133,7 @@ contract Token is TokenInterface {
133133

134134
function approve(address _spender, uint256 _amount) public returns (bool success) {
135135
allowed[msg.sender][_spender] = _amount;
136-
Approval(msg.sender, _spender, _amount);
136+
emit Approval(msg.sender, _spender, _amount);
137137
return true;
138138
}
139139

test/DAO/TokenCreation.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ contract TokenCreation is TokenCreationInterface, Token {
109109
balances[_tokenHolder] += token;
110110
totalSupply += token;
111111
weiGiven[_tokenHolder] += msg.value;
112-
CreatedToken(_tokenHolder, token);
112+
emit CreatedToken(_tokenHolder, token);
113113
if (totalSupply >= minTokensToCreate && !isFueled) {
114114
isFueled = true;
115-
FuelingToDate(totalSupply);
115+
emit FuelingToDate(totalSupply);
116116
}
117117
return true;
118118
}
@@ -127,7 +127,7 @@ contract TokenCreation is TokenCreationInterface, Token {
127127

128128
// Execute refund
129129
if (msg.sender.call.value(weiGiven[msg.sender])("")) {
130-
Refund(msg.sender, weiGiven[msg.sender]);
130+
emit Refund(msg.sender, weiGiven[msg.sender]);
131131
totalSupply -= balances[msg.sender];
132132
balances[msg.sender] = 0;
133133
weiGiven[msg.sender] = 0;

0 commit comments

Comments
 (0)