Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/script/IncredibleSquaringDeployer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ contract IncredibleSquaringDeployer is Script {
proxyAdmin = UpgradeableProxyLib.deployProxyAdmin();
require(address(incredibleSquaringStrategy) != address(0));
incrediblSquaringDeployment = IncredibleSquaringDeploymentLib.deployContracts(
proxyAdmin, configData, 0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3, isConfig, deployer
proxyAdmin, configData, configData.lstStrategy, isConfig, deployer
);
console.log("instantSlasher", incrediblSquaringDeployment.slasher);

Expand Down
43 changes: 9 additions & 34 deletions contracts/script/RegisterOperator.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,14 @@ import {
import {IAllocationManager, IAllocationManagerTypes} from "@eigenlayer/contracts/interfaces/IAllocationManager.sol";
import {IStrategy} from "@eigenlayer/contracts/interfaces/IStrategy.sol";
import {OperatorSet} from "@eigenlayer/contracts/libraries/OperatorSetLib.sol";

// Mainnet
// DELEGATION_MANAGER_ADDRESS=0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A
// Holesky
// DELEGATION_MANAGER_ADDRESS=0xA44151489861Fe9e3055d95adC98FbD462B948e7
// Mainnet
// STRATEGY_MANAGER_ADDRESS=0x858646372CC42E1A627fcE94aa7A7033e7CF075A
// Holesky
// STRATEGY_MANAGER_ADDRESS=0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6
// Holesky stETH
// LST_CONTRACT_ADDRESS=0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034
// Mainnet stETH
// LST_CONTRACT_ADDRESS=0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84
// Holesky stETH strategy
// LST_STRATEGY_ADDRESS=0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3
// Mainnet stETH strategy
// LST_STRATEGY_ADDRESS=0x93c4b944D05dfe6df7645A86cd2206016c51564D
import {CoreDeploymentLib} from "./utils/CoreDeploymentLib.sol";

contract RegisterOperator is Script {
using BN254 for BN254.G1Point;
using stdJson for string;

// Core contracts
address constant DELEGATION_MANAGER_ADDRESS_HOLESKY = 0xA44151489861Fe9e3055d95adC98FbD462B948e7;
address constant AVS_DIRECTORY_ADDRESS_HOLESKY = 0x055733000064333CaDDbC92763c58BF0192fFeBf;
address constant STRATEGY_MANAGER_ADDRESS_HOLESKY = 0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6;
// LST contracts
address constant LST_CONTRACT_ADDRESS_HOLESKY = 0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034;
address constant LST_STRATEGY_ADDRESS_HOLESKY = 0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3;
// Opacity middleware contracts
address constant OPACITY_REGISTRY_COORDINATOR_ADDRESS_HOLESKY = 0x3e43AA225b5cB026C5E8a53f62572b10D526a50B;
address constant OPACTIY_AVS_ADDRESS_HOLESKY = 0xbfc5d26C6eEb46475eB3960F5373edC5341eE535;
CoreDeploymentLib.DeploymentData internal _configData =
CoreDeploymentLib.readDeploymentJson("script/deployments/core/", block.chainid);

address registryCoordinatorMimicOwner = makeAddr("registryCoordinatorMimicOwner");

Expand All @@ -69,7 +45,7 @@ contract RegisterOperator is Script {
string memory root = vm.projectRoot();
string memory path = string.concat(root, "/docker/eigenlayer/config.json");
string memory json = vm.readFile(path);

// Read the operator socket address from config using the operator ID
return vm.parseJsonString(json, string.concat("$.operators.", operatorId, ".socketAddress"));
}
Expand Down Expand Up @@ -111,12 +87,11 @@ contract RegisterOperator is Script {
}

function registerOperator(
IRegistryCoordinator registryCoordinator,
address avs,
IRegistryCoordinator registryCoordinator,
address avs,
Operator memory operator,
string memory operatorId
) internal {
bytes memory quorumNumbers = hex"00";
// Read the socket address from config for the specific operator
string memory socket = readIPConfig(operatorId);

Expand All @@ -138,7 +113,7 @@ contract RegisterOperator is Script {
IAllocationManagerTypes.RegisterParams({avs: avs, operatorSetIds: operatorSetIds, data: encodedParams});

IStrategy[] memory strategies = new IStrategy[](1);
strategies[0] = IStrategy(LST_STRATEGY_ADDRESS_HOLESKY);
strategies[0] = IStrategy(_configData.lstStrategy);
uint64[] memory newMagnitudes = new uint64[](1);
// Ref: https://github.com/Layr-Labs/eigenlayer-contracts/blob/734f7361884d24fe51961b342e93dde1290961d0/src/contracts/libraries/SlashingLib.sol#L12
// 1e18 is 100%
Expand All @@ -164,11 +139,11 @@ contract RegisterOperator is Script {
view
returns (ISignatureUtilsMixinTypes.SignatureWithSaltAndExpiry memory)
{
bytes32 operatorRegistrationDigestHash = IAVSDirectory(AVS_DIRECTORY_ADDRESS_HOLESKY)
bytes32 operatorRegistrationDigestHash = IAVSDirectory(_configData.avsDirectory)
.calculateOperatorAVSRegistrationDigestHash(operator.operator, avs, salt, expiry);

(uint8 v, bytes32 r, bytes32 s) = vm.sign(operator.ecdsaPrivateKey, operatorRegistrationDigestHash);
bytes memory signature = abi.encodePacked(r, s, v);
return ISignatureUtilsMixinTypes.SignatureWithSaltAndExpiry({signature: signature, salt: salt, expiry: expiry});
}
}
}
2 changes: 1 addition & 1 deletion contracts/script/SetupMiddleware.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ contract SetupMiddleware is Script {

QuorumConfig memory config = readQuorumConfig();

address operatorSetStrategy = 0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3;
address operatorSetStrategy = coreData.lstStrategy;
string memory metadataURI = config.metadataURI;

IAllocationManager(coreData.allocationManager).updateAVSMetadataURI(
Expand Down
4 changes: 3 additions & 1 deletion contracts/script/deployments/core/11155111.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"rewardsCoordinator": "0x5ae8152fb88c26ff9ca5C014c94fca3c68029349",
"rewardsCoordinatorImpl": "0xcC305562B01bec562D13A40ef8781e313AFE7940",
"permissionController": "0x44632dfBdCb6D3E21EF613B0ca8A6A0c618F5a37",
"pauserRegistry": "0x63AAe451780090f50Ad323aAEF155F63a29D20f3"
"pauserRegistry": "0x63AAe451780090f50Ad323aAEF155F63a29D20f3",
"lstStrategy": "0x8b29d91e67b013e855EaFe0ad704aC4Ab086a574",
"lstToken": "0x00c71b0fCadE911B2feeE9912DE4Fe19eB04ca56"
}
}
4 changes: 3 additions & 1 deletion contracts/script/deployments/core/17000.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"rewardsCoordinator": "0xAcc1fb458a1317E886dB376Fc8141540537E68fE",
"rewardsCoordinatorImpl": "0xA3c31d2FBAD3d924baA64f8789E03E9FA7d70d69",
"permissionController": "0x598cb226B591155F767dA17AfE7A2241a68C5C10",
"pauserRegistry": "0x41Dbe7BbacA97D986FCF6f5203b98Ec02412ec1D"
"pauserRegistry": "0x41Dbe7BbacA97D986FCF6f5203b98Ec02412ec1D",
"lstStrategy": "0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3",
"lstToken": "0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034"
},
"metaDataURI": "https://raw.githubusercontent.com/ethgas-developer/ethgas-developer.github.io/main/vision-avs-2.json"
}
10 changes: 10 additions & 0 deletions contracts/script/utils/CoreDeploymentLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ library CoreDeploymentLib {
address strategyFactory;
address strategyBeacon;
address permissionController;
address lstStrategy;
address lstToken;
}

function deployContracts(address deployer, address proxyAdmin, DeploymentConfigData memory configData)
Expand Down Expand Up @@ -396,6 +398,14 @@ library CoreDeploymentLib {
data.allocationManager = json.readAddress(".addresses.allocationManager");
data.permissionController = json.readAddress(".addresses.permissionController");

// Optional LST strategy/token (present in our per-chain deployment configs)
if (vm.keyExists(json, ".addresses.lstStrategy")) {
data.lstStrategy = json.readAddress(".addresses.lstStrategy");
}
if (vm.keyExists(json, ".addresses.lstToken")) {
data.lstToken = json.readAddress(".addresses.lstToken");
}

return data;
}

Expand Down
2 changes: 0 additions & 2 deletions contracts/script/utils/IncredibleSquaringDeploymentLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,6 @@ library IncredibleSquaringDeploymentLib {
UpgradeableProxyLib.upgrade(result.socketRegistry, socketRegistryImpl);
RegistryCoordinator(result.slashingRegistryCoordinator).unpause(0);

IAllocationManagerTypes.CreateSetParams[] memory createSetParams =
new IAllocationManagerTypes.CreateSetParams[](1);
IStrategy[] memory strategies = new IStrategy[](deployedStrategyArray.length);
for (uint256 i = 0; i < deployedStrategyArray.length; i++) {
strategies[i] = deployedStrategyArray[i];
Expand Down
Loading