11// SPDX-License-Identifier: UNLICENSED
22pragma solidity >= 0.8.13 ;
33
4- import "eigenlayer-middleware/src/libraries/BN254.sol " ;
5-
64interface ITangleTaskManager {
75 // EVENTS
86 event NewTaskCreated (uint32 indexed taskIndex , Task task );
97
10- event TaskResponded (
11- TaskResponse taskResponse ,
12- TaskResponseMetadata taskResponseMetadata
13- );
8+ event TaskResponded (TaskResponse taskResponse , TaskResponseMetadata taskResponseMetadata );
149
1510 event TaskCompleted (uint32 indexed taskIndex );
1611
17- event TaskChallengedSuccessfully (
18- uint32 indexed taskIndex ,
19- address indexed challenger
20- );
21-
22- event TaskChallengedUnsuccessfully (
23- uint32 indexed taskIndex ,
24- address indexed challenger
25- );
26-
2712 // STRUCTS
2813 struct Task {
29- uint256 numberToBeSquared;
14+ // TODO: Replace your task params
15+ bytes message;
3016 uint32 taskCreatedBlock;
3117 // task submitter decides on the criteria for a task to be completed
3218 // note that this does not mean the task was "correctly" answered (i.e. the number was squared correctly)
@@ -44,36 +30,30 @@ interface ITangleTaskManager {
4430 // Can be obtained by the operator from the event NewTaskCreated.
4531 uint32 referenceTaskIndex;
4632 // This is just the response that the operator has to compute by itself.
47- uint256 numberSquared;
33+ // TODO: Replace with your expected param following Task
34+ bytes message;
4835 }
4936
5037 // Extra information related to taskResponse, which is filled inside the contract.
5138 // It thus cannot be signed by operators, so we keep it in a separate struct than TaskResponse
5239 // This metadata is needed by the challenger, so we emit it in the TaskResponded event
5340 struct TaskResponseMetadata {
54- uint32 taskResponsedBlock ;
41+ uint32 taskRespondedBlock ;
5542 bytes32 hashOfNonSigners;
5643 }
5744
5845 // FUNCTIONS
5946 // NOTE: this function creates new task.
6047 function createNewTask (
61- uint256 numberToBeSquared ,
48+ // TODO: Replace param following Task
49+ bytes calldata message ,
6250 uint32 quorumThresholdPercentage ,
6351 bytes calldata quorumNumbers
6452 ) external ;
6553
6654 /// @notice Returns the current 'taskNumber' for the middleware
6755 function taskNumber () external view returns (uint32 );
6856
69- // // NOTE: this function raises challenge to existing tasks.
70- function raiseAndResolveChallenge (
71- Task calldata task ,
72- TaskResponse calldata taskResponse ,
73- TaskResponseMetadata calldata taskResponseMetadata ,
74- BN254.G1Point[] memory pubkeysOfNonSigningOperators
75- ) external ;
76-
7757 /// @notice Returns the TASK_RESPONSE_WINDOW_BLOCK
7858 function getTaskResponseWindowBlock () external view returns (uint32 );
7959}
0 commit comments