Skip to content

Commit 941beae

Browse files
committed
refactor: fetch addresses from JSON in deploy script
1 parent 1456010 commit 941beae

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

contracts/scripts/anvil/deploy_aligned_contracts.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,21 @@ forge script ../examples/verify/script/VerifyBatchInclusionCallerDeployer.s.sol
3535
--broadcast \
3636
--sig "run(address _targetContract)"
3737

38+
output_path=./script/output/devnet/batcher_deployment_output.json
39+
3840
# Deploy Batcher Payments Contract
3941
forge_output=$(forge script script/deploy/BatcherPaymentServiceDeployer.s.sol \
4042
./script/deploy/config/devnet/batcher-payment-service.devnet.config.json \
41-
./script/deploy/output/devnet/batcher_deployment_output.json \
43+
$output_path \
4244
--rpc-url "http://localhost:8545" \
4345
--private-key "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" \
4446
--broadcast \
4547
--sig "run(string batcherConfigPath, string outputPath)")
4648

4749
# Extract the batcher payment service values from the output
4850
# new_aligned_layer_service_manager_implementation=$(echo "$forge_output" | awk '/1: address/ {print $3}')
49-
batcher_payment_service_proxy=$(echo "$forge_output" | awk '/0: address/ {print $3}')
50-
batcher_payment_service_implementation=$(echo "$forge_output" | awk '/1: address/ {print $3}')
51+
batcher_payment_service_proxy=$(jq -r '.addresses.batcherPaymentService' $output_path)
52+
batcher_payment_service_implementation=$(jq -r '.addresses.batcherPaymentServiceImplementation' $output_path)
5153

5254
# Give initial funds to ServiceManager for the Batcher
5355
cast send $ALIGNED_LAYER_SERVICE_MANAGER_ADDRESS "depositToBatcher(address)()" $batcher_payment_service_proxy --value 1ether --private-key "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" --rpc-url "http://localhost:8545"

0 commit comments

Comments
 (0)