Skip to content

Commit 2b51f25

Browse files
committed
feat: deploy.sh script for proog agg service + --via-ir flag
1 parent 64718f8 commit 2b51f25

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

contracts/scripts/proof_aggregator_service/deploy.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ forge script script/deploy/AlignedProofAggregationServiceDeployer.s.sol \
1919
--broadcast \
2020
--verify \
2121
--etherscan-api-key $ETHERSCAN_API_KEY \
22-
--sig "run(string memory batcherConfigPath, string memory outputPath)"
22+
--sig "run(string memory configPath, string memory outputPath)" \
23+
--via-ir
Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
11
#!/bin/bash
22

3-
# TODO
3+
# cd to the directory of this script so that this can be run from anywhere
4+
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
5+
6+
cd "$parent_path"
7+
8+
cd ../
9+
10+
# Save the output to a variable to later extract the address of the new deployed contract
11+
forge_output=$(forge script script/upgrade/ProofAggregatorServiceUpgrader.s.sol \
12+
$EXISTING_DEPLOYMENT_INFO_PATH \
13+
$OUTPUT_PATH \
14+
--rpc-url $RPC_URL \
15+
--private-key $PRIVATE_KEY \
16+
--broadcast \
17+
--verify \
18+
--etherscan-api-key $ETHERSCAN_API_KEY \
19+
--sig "run(string memory alignedLayerDeploymentFilePath)")
20+
21+
echo "$forge_output"
22+
23+
# Extract the proof aggregator service values from the output
24+
proof_aggregator_service_proxy=$(echo "$forge_output" | awk '/0: address/ {print $3}')
25+
proof_aggregator_service_implementation=$(echo "$forge_output" | awk '/1: address/ {print $3}')
26+
27+
# Use the extracted value to replace the batcher payment service values in alignedlayer_deployment_output.json and save it to a temporary file
28+
jq --arg proof_aggregator_service_implementation "$proof_aggregator_service_implementation" '.addresses.alignedProofAggregationServiceImplementation = $proof_aggregator_service_implementation' $OUTPUT_PATH > "$OUTPUT_PATH.temp"
29+
30+
# Replace the original file with the temporary file
31+
mv "$OUTPUT_PATH.temp" $OUTPUT_PATH
32+
33+
# Delete the temporary file
34+
rm -f "$OUTPUT_PATH.temp"
35+
36+
data=$(cast calldata "upgradeTo(address)" $batcher_payment_service_implementation)
37+
38+
echo "The new Proof Aggregator Service Implementation is $batcher_payment_service_implementation"

0 commit comments

Comments
 (0)