Skip to content

Commit 95b5185

Browse files
authored
Merge pull request #336 from kleros/feat/appeal-contribution-event
feat: added AppealContribution event to Linguo contracts
2 parents b94882b + 8280893 commit 95b5185

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

contracts/standard/arbitration/Linguo.sol

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ contract Linguo is Arbitrable {
112112
*/
113113
event TaskResolved(uint indexed _taskID, string _reason, uint _timestamp);
114114

115+
/** @dev To be emitted when someone contributes to the appeal process.
116+
* @param _taskID The ID of the respective task.
117+
* @param _party The party which received the contribution.
118+
* @param _contributor The address of the contributor.
119+
* @param _amount The amount contributed.
120+
*/
121+
event AppealContribution(uint indexed _taskID, Party _party, address _contributor, uint _amount);
122+
115123
/** @dev To be emitted when the appeal fees of one of the parties are fully funded.
116124
* @param _taskID The ID of the respective task.
117125
* @param _party The party that is fully funded.
@@ -384,6 +392,9 @@ contract Linguo is Arbitrable {
384392
(contribution, remainingETH) = calculateContribution(msg.value, totalCost.subCap(round.paidFees[uint(_side)]));
385393
round.contributions[msg.sender][uint(_side)] += contribution;
386394
round.paidFees[uint(_side)] += contribution;
395+
396+
emit AppealContribution(_taskID, _side, msg.sender, contribution);
397+
387398
// Add contribution to reward when the fee funding is successful, otherwise it can be withdrawn later.
388399
if (round.paidFees[uint(_side)] >= totalCost) {
389400
round.hasPaid[uint(_side)] = true;
@@ -682,3 +693,4 @@ contract Linguo is Arbitrable {
682693
);
683694
}
684695
}
696+

contracts/standard/arbitration/LinguoToken.sol

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ contract LinguoToken is Arbitrable {
126126
*/
127127
event TaskResolved(uint indexed _taskID, string _reason, uint _timestamp);
128128

129+
/** @dev To be emitted when someone contributes to the appeal process.
130+
* @param _taskID The ID of the respective task.
131+
* @param _party The party which received the contribution.
132+
* @param _contributor The address of the contributor.
133+
* @param _amount The amount contributed.
134+
*/
135+
event AppealContribution(uint indexed _taskID, Party _party, address _contributor, uint _amount);
136+
129137
/** @dev To be emitted when the appeal fees of one of the parties are fully funded.
130138
* @param _taskID The ID of the respective task.
131139
* @param _party The party that is fully funded.
@@ -404,6 +412,9 @@ contract LinguoToken is Arbitrable {
404412
(contribution, remainingETH) = calculateContribution(msg.value, totalCost.subCap(round.paidFees[uint(_side)]));
405413
round.contributions[msg.sender][uint(_side)] += contribution;
406414
round.paidFees[uint(_side)] += contribution;
415+
416+
emit AppealContribution(_taskID, _side, msg.sender, contribution);
417+
407418
// Add contribution to reward when the fee funding is successful, otherwise it can be withdrawn later.
408419
if (round.paidFees[uint(_side)] >= totalCost) {
409420
round.hasPaid[uint(_side)] = true;
@@ -723,4 +734,5 @@ contract LinguoToken is Arbitrable {
723734
round.feeRewards
724735
);
725736
}
726-
}
737+
}
738+

0 commit comments

Comments
 (0)