Skip to content

Commit 1683f23

Browse files
committed
feat: proof aggregator service contract upgrade multisg compliant
1 parent fe5350f commit 1683f23

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

contracts/script/upgrade/ProofAggregatorServiceUpgrader.s.sol

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ contract AlignedProofAggregationServiceUpgrader is Script {
1818

1919
AlignedProofAggregationService newProofAggregatorServiceImplementation = new AlignedProofAggregationService();
2020

21-
vm.stopBroadcast();
21+
// Not link the new implementation to the proxy
22+
// Because this must be executed in the multisig
2223

23-
vm.startBroadcast();
24-
proofAggregationServiceProxy.upgradeToAndCall(address(newProofAggregatorServiceImplementation), "");
2524
vm.stopBroadcast();
2625

2726
return (address(proofAggregationServiceProxy), address(newProofAggregatorServiceImplementation));

contracts/scripts/upgrade_proof_aggregator.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# ENV VARIABLES
44
#
5+
# MULTISIG=true|false whether the contract is deployed under a multisig account
6+
#
57
# EXISTING_DEPLOYMENT_INFO_PATH: Path to the proof aggregator deployment output file
68
# - Holesky Stage: ./script/output/holesky/proof_aggregation_service_deployment_output.stage.json
79
# - Holesky Prod: ./script/output/holesky/roof_aggregation_service_deployment_output.json
@@ -17,6 +19,11 @@
1719
# ETHERSCAN_API_KEY: The Etherscan API key to use for verification
1820
#
1921

22+
if [ -z "$MULTISIG" ]; then
23+
echo "Missing MULTISIG env variable"
24+
exit 1
25+
fi
26+
2027
# cd to the directory of this script so that this can be run from anywhere
2128
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
2229

@@ -51,3 +58,17 @@ mv "$PROOF_AGGREGATION_SERVICE_OUTPUT_PATH.temp" $PROOF_AGGREGATION_SERVICE_OUTP
5158
rm -f "$PROOF_AGGREGATION_SERVICE_OUTPUT_PATH.temp"
5259

5360
echo "The new Proof Aggregator Service Implementation is $proof_aggregator_service_implementation"
61+
62+
data=$(cast calldata "upgradeTo(address)" $proof_aggregator_service_implementation)
63+
64+
echo "The new ProofAggregator Service Implementation is $proof_aggregator_service_implementation"
65+
66+
if [ "$MULTISIG" = false ]; then
67+
echo "Executing upgrade transaction"
68+
cast send $proof_aggregator_service_proxy $data \
69+
--rpc-url $RPC_URL \
70+
--private-key $PRIVATE_KEY
71+
else
72+
echo "You can propose the upgrade transaction with the multisig using this calldata"
73+
echo $data
74+
fi

0 commit comments

Comments
 (0)