generated from BreadchainCoop/avs-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathWavsRegisterOperator.s.sol
More file actions
54 lines (44 loc) · 1.89 KB
/
WavsRegisterOperator.s.sol
File metadata and controls
54 lines (44 loc) · 1.89 KB
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
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.27;
import {Script} from "forge-std/Script.sol";
import {WavsRegisterOperatorLib} from "./utils/WavsRegisterOperatorLib.sol";
import {ReadCoreLib} from "./utils/ReadCoreLib.sol";
/**
* @title WavsRegisterOperator
* @author Lay3rLabs
* @notice This script registers an operator to the WAVS service manager.
* @dev This script is used to register an operator to the WAVS service manager.
*/
contract WavsRegisterOperator is Script {
/// @notice The environment variable for the LST strategy address.
string public constant ENV_LST_STRATEGY = "LST_STRATEGY_ADDRESS";
/// @notice The environment variable for the WAVS service manager address.
string public constant ENV_SERVICE_MANAGER = "WAVS_SERVICE_MANAGER_ADDRESS";
/// @notice The environment variable for the operator key.
string public constant ENV_OPERATOR_KEY = "OPERATOR_KEY";
address private _lstStrategyAddress;
address private _serviceManagerAddress;
uint256 private _operatorKey;
/// @notice The core deployment data.
ReadCoreLib.DeploymentData public coreDeployment;
/// @notice The setup function for the script.
function setUp() public virtual {
coreDeployment =
ReadCoreLib.readDeploymentJson("deployments/eigenlayer-core/", block.chainid);
// Get the configuration from environment
_lstStrategyAddress = vm.envAddress(ENV_LST_STRATEGY);
_serviceManagerAddress = vm.envAddress(ENV_SERVICE_MANAGER);
_operatorKey = vm.envUint(ENV_OPERATOR_KEY);
}
/// @notice The run function for the script.
function run() external {
vm.startBroadcast();
WavsRegisterOperatorLib.registerToAvs(
_operatorKey,
_serviceManagerAddress,
coreDeployment.allocationManager,
_lstStrategyAddress
);
vm.stopBroadcast();
}
}