diff --git a/contracts/script/upgrade/AlignedLayerPauserUpgrader.s.sol b/contracts/script/upgrade/AlignedLayerPauserUpgrader.s.sol deleted file mode 100644 index 14f99ffb9..000000000 --- a/contracts/script/upgrade/AlignedLayerPauserUpgrader.s.sol +++ /dev/null @@ -1,128 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.12; - -import {Script} from "forge-std/Script.sol"; -import "eigenlayer-contracts/src/contracts/core/AVSDirectory.sol"; -import {RegistryCoordinator} from "eigenlayer-middleware/RegistryCoordinator.sol"; -import {StakeRegistry} from "eigenlayer-middleware/StakeRegistry.sol"; -import {IRewardsCoordinator} from "eigenlayer-contracts/src/contracts/interfaces/IRewardsCoordinator.sol"; -import {AlignedLayerServiceManager} from "src/core/AlignedLayerServiceManager.sol"; -import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import "forge-std/StdJson.sol"; - -contract AlignedLayerPauserUpgrader is Script { - uint256 public initialPausedStatus; - - function run( - string memory eigenLayerDeploymentFilePath, - string memory deployConfigPath, - string memory alignedLayerDeploymentFilePath - ) external returns (address, address) { - // READ JSON CONFIG DATA - string memory config_data = vm.readFile(deployConfigPath); - - string memory eigen_deployment_file = vm.readFile( - eigenLayerDeploymentFilePath - ); - - string memory aligned_deployment_file = vm.readFile( - alignedLayerDeploymentFilePath - ); - - ProxyAdmin alignedLayerProxyAdmin = ProxyAdmin( - stdJson.readAddress( - aligned_deployment_file, - ".addresses.alignedLayerProxyAdmin" - ) - ); - - RegistryCoordinator registryCoordinator = RegistryCoordinator( - stdJson.readAddress( - aligned_deployment_file, - ".addresses.registryCoordinator" - ) - ); - - AVSDirectory avsDirectory = AVSDirectory( - stdJson.readAddress( - eigen_deployment_file, - ".addresses.avsDirectory" - ) - ); - - StakeRegistry stakeRegistry = StakeRegistry( - stdJson.readAddress( - aligned_deployment_file, - ".addresses.stakeRegistry" - ) - ); - - IRewardsCoordinator rewardsCoordinator = IRewardsCoordinator( - stdJson.readAddress( - eigen_deployment_file, - ".addresses.rewardsCoordinator" - ) - ); - - IPauserRegistry pauserRegistry = IPauserRegistry( - stdJson.readAddress( - aligned_deployment_file, - ".addresses.pauserRegistry" - ) - ); - - initialPausedStatus = stdJson.readUint( - config_data, - ".permissions.initalPausedStatus" - ); - - vm.startBroadcast(); - - AlignedLayerServiceManager alignedLayerServiceManagerImplementation = new AlignedLayerServiceManager( - avsDirectory, - rewardsCoordinator, - registryCoordinator, - stakeRegistry - ); - - vm.stopBroadcast(); - vm.startBroadcast(); - - // alignedLayerServiceManager is the proxy - AlignedLayerServiceManager alignedLayerServiceManager = AlignedLayerServiceManager( - payable( - stdJson.readAddress( - aligned_deployment_file, - ".addresses.alignedLayerServiceManager" - ) - ) - ); - - vm.stopBroadcast(); - vm.startBroadcast(); - - alignedLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy( - payable(address(alignedLayerServiceManager)) - ), - address(alignedLayerServiceManagerImplementation) - ); - - vm.stopBroadcast(); - vm.startBroadcast(); - - alignedLayerServiceManager.initializePauser( - pauserRegistry, - initialPausedStatus - ); - - vm.stopBroadcast(); - - return ( - address(alignedLayerServiceManager), - address(alignedLayerServiceManagerImplementation) - ); - } -} - diff --git a/contracts/script/upgrade/AlignedLayerUpgradeAddAggregator.s.sol b/contracts/script/upgrade/AlignedLayerUpgradeAddAggregator.s.sol deleted file mode 100644 index 8fea4281d..000000000 --- a/contracts/script/upgrade/AlignedLayerUpgradeAddAggregator.s.sol +++ /dev/null @@ -1,114 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.12; - -import {Script} from "forge-std/Script.sol"; -import "eigenlayer-contracts/src/contracts/core/AVSDirectory.sol"; -import {RegistryCoordinator} from "eigenlayer-middleware/RegistryCoordinator.sol"; -import {StakeRegistry} from "eigenlayer-middleware/StakeRegistry.sol"; -import {IRewardsCoordinator} from "eigenlayer-contracts/src/contracts/interfaces/IRewardsCoordinator.sol"; -import {AlignedLayerServiceManager} from "src/core/AlignedLayerServiceManager.sol"; -import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import "forge-std/StdJson.sol"; - -contract AlignedLayerSetAggregator is Script { - function run( - string memory eigenLayerDeploymentFilePath, - string memory alignedLayerDeploymentFilePath, - string memory alignedConfigFilePath - ) external returns (address, address) { - string memory eigen_deployment_file = vm.readFile( - eigenLayerDeploymentFilePath - ); - - string memory aligned_deployment_file = vm.readFile( - alignedLayerDeploymentFilePath - ); - - string memory aligned_config_file = vm.readFile(alignedConfigFilePath); - - ProxyAdmin alignedLayerProxyAdmin = ProxyAdmin( - stdJson.readAddress( - aligned_deployment_file, - ".addresses.alignedLayerProxyAdmin" - ) - ); - - RegistryCoordinator registryCoordinator = RegistryCoordinator( - stdJson.readAddress( - aligned_deployment_file, - ".addresses.registryCoordinator" - ) - ); - - AVSDirectory avsDirectory = AVSDirectory( - stdJson.readAddress( - eigen_deployment_file, - ".addresses.avsDirectory" - ) - ); - - StakeRegistry stakeRegistry = StakeRegistry( - stdJson.readAddress( - aligned_deployment_file, - ".addresses.stakeRegistry" - ) - ); - - IRewardsCoordinator rewardsCoordinator = IRewardsCoordinator( - stdJson.readAddress( - eigen_deployment_file, - ".addresses.rewardsCoordinator" - ) - ); - - address alignedLayerAggregator = stdJson.readAddress( - aligned_config_file, - ".permissions.aggregator" - ); - - vm.startBroadcast(); - - AlignedLayerServiceManager alignedLayerServiceManagerImplementation = new AlignedLayerServiceManager( - avsDirectory, - rewardsCoordinator, - registryCoordinator, - stakeRegistry - ); - - vm.stopBroadcast(); - vm.startBroadcast(); - - // alignedLayerServiceManager is the proxy - AlignedLayerServiceManager alignedLayerServiceManager = AlignedLayerServiceManager( - payable( - stdJson.readAddress( - aligned_deployment_file, - ".addresses.alignedLayerServiceManager" - ) - ) - ); - - vm.stopBroadcast(); - vm.startBroadcast(); - - alignedLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy( - payable(address(alignedLayerServiceManager)) - ), - address(alignedLayerServiceManagerImplementation) - ); - - vm.stopBroadcast(); - vm.startBroadcast(); - - alignedLayerServiceManager.initializeAggregator(alignedLayerAggregator); - - vm.stopBroadcast(); - - return ( - address(alignedLayerServiceManager), - address(alignedLayerServiceManagerImplementation) - ); - } -} diff --git a/contracts/scripts/upgrade_add_aggregator_to_service_manager.sh b/contracts/scripts/upgrade_add_aggregator_to_service_manager.sh deleted file mode 100644 index 43f209d94..000000000 --- a/contracts/scripts/upgrade_add_aggregator_to_service_manager.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# cd to the directory of this script so that this can be run from anywhere -parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) - -cd "$parent_path" - -cd ../../contracts - -# Save the output to a variable to later extract the address of the new deployed contract -forge_output=$(forge script script/upgrade/AlignedLayerUpgradeAddAggregator.s.sol \ - $EXISTING_DEPLOYMENT_INFO_PATH \ - $OUTPUT_PATH \ - $DEPLOY_CONFIG_PATH \ - --rpc-url $RPC_URL \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --verify \ - --etherscan-api-key $ETHERSCAN_API_KEY \ - --sig "run(string memory eigenLayerDeploymentFilePath, string memory alignedLayerDeploymentFilePath, string memory alignedConfigFilePath)") - -echo "$forge_output" - -# Extract the alignedLayerServiceManagerImplementation value from the output -new_aligned_layer_service_manager_implementation=$(echo "$forge_output" | awk '/1: address/ {print $3}') - -# Use the extracted value to replace the alignedLayerServiceManagerImplementation value in alignedlayer_deployment_output.json and save it to a temporary file -jq --arg new_aligned_layer_service_manager_implementation "$new_aligned_layer_service_manager_implementation" '.addresses.alignedLayerServiceManagerImplementation = $new_aligned_layer_service_manager_implementation' $OUTPUT_PATH > "script/output/holesky/alignedlayer_deployment_output.temp.json" - -# Write aggregator addres to deployment output file -ALIGNED_LAYER_AGGREGATOR_ADDRESS=$(jq -r '.permissions.aggregator' $DEPLOY_CONFIG_PATH) -jq --arg alignedLayerAggregator "$ALIGNED_LAYER_AGGREGATOR_ADDRESS" '.permissions += {"alignedLayerAggregator": $alignedLayerAggregator}' "script/output/holesky/alignedlayer_deployment_output.temp.json" > "script/output/holesky/alignedlayer_deployment_output.temp2.json" - -# Replace the original file with the temporary file -mv "script/output/holesky/alignedlayer_deployment_output.temp2.json" $OUTPUT_PATH - -# Delete the temporary file -rm -f "script/output/holesky/alignedlayer_deployment_output.temp.json" diff --git a/contracts/scripts/upgrade_add_pausable_to_service_manager.sh b/contracts/scripts/upgrade_add_pausable_to_service_manager.sh deleted file mode 100644 index d629a39b8..000000000 --- a/contracts/scripts/upgrade_add_pausable_to_service_manager.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# cd to the directory of this script so that this can be run from anywhere -parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) - -cd "$parent_path" - -cd ../ - -# Save the output to a variable to later extract the address of the new deployed contract -forge_output=$(forge script script/upgrade/AlignedLayerPauserUpgrader.s.sol \ - $EXISTING_DEPLOYMENT_INFO_PATH \ - $DEPLOY_CONFIG_PATH \ - $OUTPUT_PATH \ - --rpc-url $RPC_URL \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --sig "run(string memory eigenLayerDeploymentFilePath, string memory deployConfigPath, string memory alignedLayerDeploymentFilePath, )") - -echo "$forge_output" - -# Extract the alignedLayerServiceManagerImplementation value from the output -new_aligned_layer_service_manager_implementation=$(echo "$forge_output" | awk '/1: address/ {print $3}') - -# Use the extracted value to replace the alignedLayerServiceManagerImplementation value in alignedlayer_deployment_output.json and save it to a temporary file -jq --arg new_aligned_layer_service_manager_implementation "$new_aligned_layer_service_manager_implementation" '.addresses.alignedLayerServiceManagerImplementation = $new_aligned_layer_service_manager_implementation' "$OUTPUT_PATH" > "script/output/holesky/alignedlayer_deployment_output.temp.json" - -# Replace the original file with the temporary file -mv "script/output/holesky/alignedlayer_deployment_output.temp.json" "$OUTPUT_PATH" - -# Delete the temporary file -rm -f "script/output/holesky/alignedlayer_deployment_output.temp.json"