From 069e7f1256ef84a0ad387139342162c37cd377c7 Mon Sep 17 00:00:00 2001 From: Jonas Bostoen Date: Sun, 20 Oct 2024 18:03:15 +0200 Subject: [PATCH] feat(contracts/script): fix scripts --- bolt-contracts/config/holesky/deployments.json | 6 +++--- bolt-contracts/config/holesky/validators.json | 2 +- .../script/holesky/admin/helpers/RegisterAVS.s.sol | 2 +- .../script/holesky/admin/helpers/Symbiotic.s.sol | 2 +- .../holesky/validators/RegisterEigenLayerOperator.s.sol | 9 +++++++-- .../holesky/validators/RegisterSymbioticOperator.s.sol | 1 + 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bolt-contracts/config/holesky/deployments.json b/bolt-contracts/config/holesky/deployments.json index ed97c055..4e8d76a8 100644 --- a/bolt-contracts/config/holesky/deployments.json +++ b/bolt-contracts/config/holesky/deployments.json @@ -1,6 +1,6 @@ { "bolt": { - "validators": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + "validators": "0x05275a4799cd1B07D81319390fC62Bc7BDbDf269" }, "symbiotic": { "network": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", @@ -9,7 +9,7 @@ "vaultFactory": "0x18C659a269a7172eF78BBC19Fe47ad2237Be0590", "networkRegistry": "0xac5acD8A105C8305fb980734a5AD920b5920106A", "networkMiddlewareService": "0x683F470440964E353b389391CdDDf8df381C282f", - "middleware": "0x61B626A562d39439Ab60fCbF19678Dac036D1209", + "middleware": "", "supportedVaults": [ "0x1df2fbfcD600ADd561013f44B2D055E2e974f605", "0xf427d00c34609053d97167352061DD2F0F27F853" @@ -19,7 +19,7 @@ "avsDirectory": "0x055733000064333CaDDbC92763c58BF0192fFeBf", "delegationManager": "0xA44151489861Fe9e3055d95adC98FbD462B948e7", "strategyManager": "0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6", - "middleware": "0x2575d6D30767149c99589cce743656fA3866ca2e", + "middleware": "", "supportedStrategies": [ "0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3", "0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0", diff --git a/bolt-contracts/config/holesky/validators.json b/bolt-contracts/config/holesky/validators.json index 7952b9a4..5f065521 100644 --- a/bolt-contracts/config/holesky/validators.json +++ b/bolt-contracts/config/holesky/validators.json @@ -1,6 +1,6 @@ { "maxCommittedGasLimit": 10000000, - "authorizedOperator": "0x", + "authorizedOperator": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "pubkeys": [ "0xad02df40e24e8534dc4c175163f7a034f99f2e81c43b7ea19904006cb05d001b5301d3444f1812b101803b7f72e340fa", "0xa4c0a8b5dd70d0fe8f05580143bea4c40badb176c2b0c20001cddf897a11bb832137fa4050af1d0420a7dc27568697df" diff --git a/bolt-contracts/script/holesky/admin/helpers/RegisterAVS.s.sol b/bolt-contracts/script/holesky/admin/helpers/RegisterAVS.s.sol index a424d721..f4a3117d 100644 --- a/bolt-contracts/script/holesky/admin/helpers/RegisterAVS.s.sol +++ b/bolt-contracts/script/holesky/admin/helpers/RegisterAVS.s.sol @@ -26,6 +26,6 @@ contract RegisterAVS is Script { string memory path = string.concat(root, "/config/holesky/deployments.json"); string memory json = vm.readFile(path); - return vm.parseJsonAddress(json, ".eigenLayer.networkMiddleware"); + return vm.parseJsonAddress(json, ".eigenLayer.middleware"); } } diff --git a/bolt-contracts/script/holesky/admin/helpers/Symbiotic.s.sol b/bolt-contracts/script/holesky/admin/helpers/Symbiotic.s.sol index e5b44c13..c899a9e7 100644 --- a/bolt-contracts/script/holesky/admin/helpers/Symbiotic.s.sol +++ b/bolt-contracts/script/holesky/admin/helpers/Symbiotic.s.sol @@ -61,6 +61,6 @@ contract SymbioticHelper is Script { string memory path = string.concat(root, "/config/holesky/deployments.json"); string memory json = vm.readFile(path); - return vm.parseJsonAddress(json, ".symbiotic.networkMiddleware"); + return vm.parseJsonAddress(json, ".symbiotic.middleware"); } } diff --git a/bolt-contracts/script/holesky/validators/RegisterEigenLayerOperator.s.sol b/bolt-contracts/script/holesky/validators/RegisterEigenLayerOperator.s.sol index 20e281d4..3acbe2d8 100644 --- a/bolt-contracts/script/holesky/validators/RegisterEigenLayerOperator.s.sol +++ b/bolt-contracts/script/holesky/validators/RegisterEigenLayerOperator.s.sol @@ -6,7 +6,11 @@ import {Script, console} from "forge-std/Script.sol"; import {IAVSDirectory} from "@eigenlayer/src/contracts/interfaces/IAVSDirectory.sol"; import {ISignatureUtils} from "@eigenlayer/src/contracts/interfaces/ISignatureUtils.sol"; +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + import {BoltEigenLayerMiddlewareV1} from "../../../src/contracts/BoltEigenLayerMiddlewareV1.sol"; +import {IBoltMiddlewareV1} from "../../../src/interfaces/IBoltMiddlewareV1.sol"; contract RegisterEigenLayerOperator is Script { struct OperatorConfig { @@ -28,8 +32,6 @@ contract RegisterEigenLayerOperator is Script { console.log("Operator address:", operator); console.log("Operator RPC:", config.rpc); - vm.startBroadcast(operatorSk); - bytes32 digest = avsDirectory.calculateOperatorAVSRegistrationDigestHash({ operator: operator, avs: address(middleware), @@ -43,7 +45,10 @@ contract RegisterEigenLayerOperator is Script { ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature = ISignatureUtils.SignatureWithSaltAndExpiry(rawSignature, config.salt, config.expiry); + vm.startBroadcast(operatorSk); + middleware.registerOperator(config.rpc, operatorSignature); + console.log("Successfully registered EigenLayer operator"); vm.stopBroadcast(); } diff --git a/bolt-contracts/script/holesky/validators/RegisterSymbioticOperator.s.sol b/bolt-contracts/script/holesky/validators/RegisterSymbioticOperator.s.sol index df1b6b66..57264a4c 100644 --- a/bolt-contracts/script/holesky/validators/RegisterSymbioticOperator.s.sol +++ b/bolt-contracts/script/holesky/validators/RegisterSymbioticOperator.s.sol @@ -20,6 +20,7 @@ contract RegisterSymbioticOperator is Script { vm.startBroadcast(operatorSk); middleware.registerOperator(rpc); + console.log("Successfully registered Symbiotic operator"); vm.stopBroadcast(); }