File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/contracts/contracts/maci Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,7 @@ contract Tally is TallyBase, IPayoutStrategy {
150150 if (amount == 0 ) {
151151 revert DepositMustBeGreaterThanZero ();
152152 }
153+
153154 emit Deposited (msg .sender , amount);
154155
155156 token.safeTransferFrom (msg .sender , address (this ), amount);
@@ -194,6 +195,10 @@ contract Tally is TallyBase, IPayoutStrategy {
194195 uint256 perVOSpentVoiceCreditsHash ,
195196 uint8 voteOptionTreeDepth
196197 ) internal override {
198+ uint256 previousValue = tallyResults[voteOptionIndex].value;
199+
200+ totalVotesSquares += tallyResult ** 2 - previousValue ** 2 ;
201+
197202 super .addTallyResult (
198203 voteOptionIndex,
199204 tallyResult,
@@ -204,8 +209,6 @@ contract Tally is TallyBase, IPayoutStrategy {
204209 voteOptionTreeDepth
205210 );
206211
207- totalVotesSquares += tallyResult ** 2 ;
208-
209212 emit ResultAdded (voteOptionIndex, tallyResult);
210213 }
211214
You can’t perform that action at this time.
0 commit comments