11/**
22 * @authors: [@unknownunknown1]
3- * @reviewers: [@ferittuncer*, @clesaege*, @satello*]
3+ * @reviewers: [@ferittuncer*, @clesaege*, @satello*, @hbarcelos ]
44 * @auditors: []
55 * @bounties: []
66 * @deployments: []
@@ -76,15 +76,39 @@ contract Linguo is Arbitrable {
7676 /** @dev To be emitted when the new task is created.
7777 * @param _taskID The ID of the newly created task.
7878 * @param _requester The address that created the task.
79+ * @param _timestamp When the task was created.
7980 */
80- event TaskCreated (uint indexed _taskID , address indexed _requester );
81+ event TaskCreated (uint indexed _taskID , address indexed _requester , uint _timestamp );
82+
83+ /** @dev To be emitted when a translator assigns the task to himself.
84+ * @param _taskID The ID of the newly created task.
85+ * @param _translator The address that assigned to the task.
86+ * @param _price The task price at the moment it was assigned.
87+ * @param _timestamp When the task was assigned.
88+ */
89+ event TaskAssigned (uint indexed _taskID , address indexed _translator , uint _price , uint _timestamp );
8190
8291 /** @dev To be emitted when a translation is submitted.
8392 * @param _taskID The ID of the respective task.
8493 * @param _translator The address that performed the translation.
8594 * @param _translatedText A URI to the translated text.
95+ * @param _timestamp When the translation was submitted.
8696 */
87- event TranslationSubmitted (uint indexed _taskID , address indexed _translator , string _translatedText );
97+ event TranslationSubmitted (uint indexed _taskID , address indexed _translator , string _translatedText , uint _timestamp );
98+
99+ /** @dev To be emitted when a translation is challenged.
100+ * @param _taskID The ID of the respective task.
101+ * @param _challenger The address of the challenger.
102+ * @param _timestamp When the task was challenged.
103+ */
104+ event TranslationChallenged (uint indexed _taskID , address indexed _challenger , uint _timestamp );
105+
106+ /** @dev To be emitted when a task is resolved, either by the translation being accepted, the requester being reimbursed or a dispute being settled.
107+ * @param _taskID The ID of the respective task.
108+ * @param _reason Short description of what caused the task to be solved. One of: 'translation-accepted' | 'requester-reimbursed' | 'dispute-settled'
109+ * @param _timestamp When the task was resolved.
110+ */
111+ event TaskResolved (uint indexed _taskID , string _reason , uint _timestamp );
88112
89113 /** @dev To be emitted when one of the parties successfully paid its appeal fees.
90114 * @param _taskID The ID of the respective task.
@@ -191,7 +215,7 @@ contract Linguo is Arbitrable {
191215 uint _deadline ,
192216 uint _minPrice ,
193217 string _metaEvidence
194- ) external payable returns (uint taskID ){
218+ ) external payable returns (uint taskID ) {
195219 require (msg .value >= _minPrice, "Deposited value should be greater than or equal to the min price. " );
196220 require (_deadline > now , "The deadline should be in the future. " );
197221
@@ -205,7 +229,7 @@ contract Linguo is Arbitrable {
205229 task.requesterDeposit = msg .value ;
206230
207231 emit MetaEvidence (taskID, _metaEvidence);
208- emit TaskCreated (taskID, msg .sender );
232+ emit TaskCreated (taskID, msg .sender , now );
209233 }
210234
211235 /** @dev Assigns a specific task to the sender. Requires a translator's deposit.
@@ -234,6 +258,8 @@ contract Linguo is Arbitrable {
234258
235259 remainder = msg .value - deposit;
236260 msg .sender .send (remainder);
261+
262+ emit TaskAssigned (_taskID, msg .sender , price, now );
237263 }
238264
239265 /** @dev Submits translated text for a specific task.
@@ -248,7 +274,7 @@ contract Linguo is Arbitrable {
248274 task.status = Status.AwaitingReview;
249275 task.lastInteraction = now ;
250276
251- emit TranslationSubmitted (_taskID, msg .sender , _translation);
277+ emit TranslationSubmitted (_taskID, msg .sender , _translation, now );
252278 }
253279
254280 /** @dev Reimburses the requester if no one picked the task or the translator failed to submit the translation before deadline.
@@ -265,6 +291,8 @@ contract Linguo is Arbitrable {
265291
266292 task.requesterDeposit = 0 ;
267293 task.sumDeposit = 0 ;
294+
295+ emit TaskResolved (_taskID, "requester-reimbursed " , now );
268296 }
269297
270298 /** @dev Pays the translator for completed task if no one challenged the translation during review period.
@@ -281,6 +309,8 @@ contract Linguo is Arbitrable {
281309
282310 task.requesterDeposit = 0 ;
283311 task.sumDeposit = 0 ;
312+
313+ emit TaskResolved (_taskID, "translation-accepted " , now );
284314 }
285315
286316 /** @dev Challenges the translation of a specific task. Requires challenger's deposit.
@@ -308,6 +338,7 @@ contract Linguo is Arbitrable {
308338 msg .sender .send (remainder);
309339
310340 emit Dispute (arbitrator, task.disputeID, _taskID, _taskID);
341+ emit TranslationChallenged (_taskID, msg .sender , now );
311342 }
312343
313344 /** @dev Takes up to the total amount required to fund a side of an appeal. Reimburses the rest. Creates an appeal if all sides are fully funded.
@@ -482,6 +513,8 @@ contract Linguo is Arbitrable {
482513
483514 task.requesterDeposit = 0 ;
484515 task.sumDeposit = 0 ;
516+
517+ emit TaskResolved (taskID, "dispute-settled " , now );
485518 }
486519
487520 /** @dev Submit a reference to evidence. EVENT.
0 commit comments