@@ -88,10 +88,10 @@ contract GenesisProtocol is IntVoteInterface {
88
88
mapping (address => Staker ) stakers;
89
89
}
90
90
91
- event Stake (bytes32 indexed _proposalId , bytes32 indexed _organizationId , address indexed _staker ,uint _vote ,uint _amount );
92
- event Redeem (bytes32 indexed _proposalId , bytes32 indexed _organizationId , address indexed _beneficiary ,uint _amount );
93
- event RedeemDaoBounty (bytes32 indexed _proposalId , bytes32 indexed _organizationId , address indexed _beneficiary ,uint _amount );
94
- event RedeemReputation (bytes32 indexed _proposalId , bytes32 indexed _organizationId , address indexed _beneficiary ,uint _amount );
91
+ event Stake (bytes32 indexed _proposalId , address indexed _organization , address indexed _staker ,uint _vote ,uint _amount );
92
+ event Redeem (bytes32 indexed _proposalId , address indexed _organization , address indexed _beneficiary ,uint _amount );
93
+ event RedeemDaoBounty (bytes32 indexed _proposalId , address indexed _organization , address indexed _beneficiary ,uint _amount );
94
+ event RedeemReputation (bytes32 indexed _proposalId , address indexed _organization , address indexed _beneficiary ,uint _amount );
95
95
event GPExecuteProposal (bytes32 indexed _proposalId , ExecutionState _executionState );
96
96
97
97
mapping (bytes32 => Parameters) public parameters; // A mapping from hashes to parameters
@@ -103,6 +103,8 @@ contract GenesisProtocol is IntVoteInterface {
103
103
uint public proposalsCnt; // Total number of proposals
104
104
mapping (bytes32 => uint ) public orgBoostedProposalsCnt;
105
105
mapping (bytes32 => OrderStatisticTree.Tree) proposalsExpiredTimes; //proposals expired times
106
+ //organizationId => organization
107
+ mapping (bytes32 => address ) organizations;
106
108
StandardToken public stakingToken;
107
109
mapping (bytes => bool ) stakeSignatures; //stake signatures
108
110
address constant GEN_TOKEN_ADDRESS = 0x543Ff227F64Aa17eA132Bf9886cAb5DB55DCAddf ;
@@ -169,7 +171,14 @@ contract GenesisProtocol is IntVoteInterface {
169
171
proposal.winningVote = NO;
170
172
proposal.paramsHash = _paramsHash;
171
173
proposals[proposalId] = proposal;
172
- emit NewProposal (proposalId, proposal.organizationId, _numOfChoices, _proposer, _paramsHash);
174
+ if (organizations[proposal.organizationId] == 0 ) {
175
+ if (_organization == address (0 )) {
176
+ organizations[proposal.organizationId] = msg .sender ;
177
+ } else {
178
+ organizations[proposal.organizationId] = _organization;
179
+ }
180
+ }
181
+ emit NewProposal (proposalId, organizations[proposal.organizationId], _numOfChoices, _proposer, _paramsHash);
173
182
return proposalId;
174
183
}
175
184
@@ -506,11 +515,11 @@ contract GenesisProtocol is IntVoteInterface {
506
515
if (amount != 0 ) {
507
516
proposal.totalStakes[1 ] = proposal.totalStakes[1 ].sub (amount);
508
517
require (stakingToken.transfer (_beneficiary, amount));
509
- emit Redeem (_proposalId,proposal.organizationId,_beneficiary,amount);
518
+ emit Redeem (_proposalId,organizations[ proposal.organizationId] ,_beneficiary,amount);
510
519
}
511
520
if (reputation != 0 ) {
512
521
VotingMachineCallbacksInterface (proposal.callbacks).mintReputation (reputation,_beneficiary,_proposalId);
513
- emit RedeemReputation (_proposalId,proposal.organizationId,_beneficiary,reputation);
522
+ emit RedeemReputation (_proposalId,organizations[ proposal.organizationId] ,_beneficiary,reputation);
514
523
}
515
524
}
516
525
@@ -549,7 +558,7 @@ contract GenesisProtocol is IntVoteInterface {
549
558
require (VotingMachineCallbacksInterface (proposal.callbacks).stakingTokenTransfer (stakingToken,_beneficiary,potentialAmount,_proposalId));
550
559
proposal.stakers[_beneficiary].amountForBounty = 0 ;
551
560
redeemedAmount = potentialAmount;
552
- emit RedeemDaoBounty (_proposalId,proposal.organizationId,_beneficiary,redeemedAmount);
561
+ emit RedeemDaoBounty (_proposalId,organizations[ proposal.organizationId] ,_beneficiary,redeemedAmount);
553
562
}
554
563
}
555
564
@@ -766,7 +775,7 @@ contract GenesisProtocol is IntVoteInterface {
766
775
}
767
776
proposal.daoBountyRemain = daoBountyRemain;
768
777
}
769
- emit ExecuteProposal (_proposalId, proposal.organizationId, proposal.winningVote, totalReputation);
778
+ emit ExecuteProposal (_proposalId, organizations[ proposal.organizationId] , proposal.winningVote, totalReputation);
770
779
emit GPExecuteProposal (_proposalId, executionState);
771
780
ProposalExecuteInterface (proposal.callbacks).executeProposal (_proposalId,int (proposal.winningVote));
772
781
}
@@ -815,7 +824,7 @@ contract GenesisProtocol is IntVoteInterface {
815
824
amount = amount - ((params.stakerFeeRatioForVoters* amount)/ 100 );
816
825
proposal.totalStakes[0 ] = amount.add (proposal.totalStakes[0 ]);
817
826
// Event:
818
- emit Stake (_proposalId, proposal.organizationId, _staker, _vote, _amount);
827
+ emit Stake (_proposalId, organizations[ proposal.organizationId] , _staker, _vote, _amount);
819
828
// execute the proposal if this vote was decisive:
820
829
return _execute (_proposalId);
821
830
}
@@ -886,7 +895,7 @@ contract GenesisProtocol is IntVoteInterface {
886
895
VotingMachineCallbacksInterface (proposal.callbacks).burnReputation (reputationDeposit,_voter,_proposalId);
887
896
}
888
897
// Event:
889
- emit VoteProposal (_proposalId, proposal.organizationId, _voter, _vote, rep);
898
+ emit VoteProposal (_proposalId, organizations[ proposal.organizationId] , _voter, _vote, rep);
890
899
// execute the proposal if this vote was decisive:
891
900
return _execute (_proposalId);
892
901
}
0 commit comments