Skip to content

Commit 8e1788c

Browse files
committed
chore: add multisig support to upgrade ServiceManager
1 parent f2d7b5b commit 8e1788c

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

contracts/script/upgrade/AlignedLayerUpgrader.s.sol

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,6 @@ contract AlignedLayerUpgrader is Script {
8080
)
8181
);
8282

83-
vm.startBroadcast();
84-
85-
alignedLayerProxyAdmin.upgrade(
86-
TransparentUpgradeableProxy(
87-
payable(address(alignedLayerServiceManager))
88-
),
89-
address(alignedLayerServiceManagerImplementation)
90-
);
91-
92-
vm.stopBroadcast();
93-
9483
return (
9584
address(alignedLayerServiceManager),
9685
address(alignedLayerServiceManagerImplementation)

contracts/scripts/upgrade_aligned_contracts.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,26 @@ forge_output=$(forge script script/upgrade/AlignedLayerUpgrader.s.sol \
2121
echo "$forge_output"
2222

2323
# Extract the alignedLayerServiceManagerImplementation value from the output
24+
aligned_layer_service_manager=$(echo "$forge_output" | awk '/0: address/ {print $3}')
2425
new_aligned_layer_service_manager_implementation=$(echo "$forge_output" | awk '/1: address/ {print $3}')
2526

2627
# Use the extracted value to replace the alignedLayerServiceManagerImplementation value in alignedlayer_deployment_output.json and save it to a temporary file
27-
jq --arg new_aligned_layer_service_manager_implementation "$new_aligned_layer_service_manager_implementation" '.addresses.alignedLayerServiceManagerImplementation = $new_aligned_layer_service_manager_implementation' "script/output/holesky/alignedlayer_deployment_output.json" > "script/output/holesky/alignedlayer_deployment_output.temp.json"
28+
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"
2829

2930
# Replace the original file with the temporary file
30-
mv "script/output/holesky/alignedlayer_deployment_output.temp.json" "script/output/holesky/alignedlayer_deployment_output.json"
31+
mv "script/output/holesky/alignedlayer_deployment_output.temp.json" $OUTPUT_PATH
3132

3233
# Delete the temporary file
3334
rm -f "script/output/holesky/alignedlayer_deployment_output.temp.json"
35+
36+
data=$(cast calldata "upgrade(address, address)" $aligned_layer_service_manager $new_aligned_layer_service_manager_implementation)
37+
38+
if [ -z $MULTISIG ]; then
39+
proxy_admin=$(jq -r '.addresses.alignedLayerProxyAdmin' $OUTPUT_PATH)
40+
cast send $proxy_admin $data \
41+
--rpc-url $RPC_URL \
42+
--private-key $PRIVATE_KEY
43+
else
44+
echo "To send the transaction using multisig use this calldata"
45+
echo $data
46+
fi

0 commit comments

Comments
 (0)