-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSertnServiceManager.sol
55 lines (48 loc) · 1.81 KB
/
SertnServiceManager.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "@eigenlayer/contracts/libraries/BytesLib.sol";
import "./ISertnTaskManager.sol";
import "@eigenlayer-middleware/src/ServiceManagerBase.sol";
/**
* @title Primary entrypoint for procuring services from Sertn.
* @author Layr Labs, Inc.
*/
contract SertnServiceManager is ServiceManagerBase {
using BytesLib for bytes;
ISertnTaskManager public immutable sertnTaskManager;
/// @notice when applied to a function, ensures that the function is only callable by the `registryCoordinator`.
modifier onlySertnTaskManager() {
require(
msg.sender == address(sertnTaskManager),
"onlySertnTaskManager: not from sertn task manager"
);
_;
}
constructor(
IAVSDirectory _avsDirectory,
IRegistryCoordinator _registryCoordinator,
IStakeRegistry _stakeRegistry,
address _sertnTaskManager
)
ServiceManagerBase(
_avsDirectory,
IPaymentCoordinator(address(0)),
_registryCoordinator,
_stakeRegistry
)
{
sertnTaskManager = ISertnTaskManager(_sertnTaskManager);
}
function initialize(address _sertnOwner) public initializer {
__Ownable_init();
super._transferOwnership(_sertnOwner);
}
/// @notice Called in the event of challenge resolution, in order to forward a call to the Slasher, which 'freezes' the `operator`.
/// @dev The Slasher contract is under active development and its interface expected to change.
/// We recommend writing slashing logic without integrating with the Slasher at this point in time.
function freezeOperator(
address operatorAddr
) external onlySertnTaskManager {
// slasher.freezeOperator(operatorAddr);
}
}