|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +RPC_URL="http://localhost:8545" |
| 4 | + |
| 5 | +cd contracts |
| 6 | + |
| 7 | +ALIGNED_LAYER_SERVICE_MANAGER_ADDRESS=$(jq -r '.addresses.alignedLayerServiceManager' ./script/output/devnet/alignedlayer_deployment_output.json) |
| 8 | + |
| 9 | +sleep 1 |
| 10 | + |
| 11 | +# Deploy the contracts |
| 12 | +forge script script/deploy/AlignedLayerDeployer.s.sol \ |
| 13 | + ./script/output/devnet/eigenlayer_deployment_output.json \ |
| 14 | + ./script/deploy/config/devnet/aligned.devnet.config.json \ |
| 15 | + ./script/output/devnet/alignedlayer_deployment_output.json \ |
| 16 | + --rpc-url $RPC_URL \ |
| 17 | + --private-key "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" \ |
| 18 | + --broadcast \ |
| 19 | + --sig "run(string memory existingDeploymentInfoPath, string memory deployConfigPath, string memory outputPath)" |
| 20 | + |
| 21 | + |
| 22 | +ALIGNED_LAYER_SERVICE_MANAGER_ADDRESS=$(jq -r '.addresses.alignedLayerServiceManager' ./script/output/devnet/alignedlayer_deployment_output.json) |
| 23 | + |
| 24 | +# Can't deploy on another script, current open issue: https://github.com/foundry-rs/foundry/issues/7952 |
| 25 | +forge script ../examples/verify/script/VerifyBatchInclusionCallerDeployer.s.sol \ |
| 26 | + "$ALIGNED_LAYER_SERVICE_MANAGER_ADDRESS" \ |
| 27 | + --rpc-url $RPC_URL \ |
| 28 | + --private-key "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" \ |
| 29 | + --broadcast \ |
| 30 | + --sig "run(address _targetContract)" |
| 31 | + |
| 32 | +output_path=./script/output/devnet/batcher_deployment_output.json |
| 33 | + |
| 34 | +# Deploy Batcher Payments Contract |
| 35 | +forge script script/deploy/BatcherPaymentServiceDeployer.s.sol \ |
| 36 | + ./script/deploy/config/devnet/batcher-payment-service.devnet.config.json \ |
| 37 | + $output_path \ |
| 38 | + --rpc-url $RPC_URL \ |
| 39 | + --private-key "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" \ |
| 40 | + --broadcast \ |
| 41 | + --sig "run(string batcherConfigPath, string outputPath)" |
| 42 | + |
| 43 | +# Extract the batcher payment service values from the output |
| 44 | +batcher_payment_service_proxy=$(jq -r '.addresses.batcherPaymentService' $output_path) |
| 45 | +batcher_payment_service_implementation=$(jq -r '.addresses.batcherPaymentServiceImplementation' $output_path) |
| 46 | + |
| 47 | +# Give initial funds to ServiceManager for the Batcher |
| 48 | +cast send $ALIGNED_LAYER_SERVICE_MANAGER_ADDRESS "depositToBatcher(address)()" $batcher_payment_service_proxy --value 1ether --private-key "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" --rpc-url $RPC_URL |
| 49 | + |
| 50 | +cd .. |
0 commit comments