-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·41 lines (30 loc) · 1.31 KB
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# set -e
source .env
# Split the CHAIN_KEYS variable by comma, then iterate over each pair
IFS=',' read -r -a pairs <<< "$CHAIN_KEYS"
for pair in "${pairs[@]}"; do
# Split each pair by '='
IFS=';' read -r -a kv <<< "$pair"
RPC_URL="${kv[0]}"
ETHERSCAN_KEY="${kv[1]}"
ETHERSCAN_URL="${kv[2]}"
echo "Deploying to $RPC_URL, verifying with $ETHERSCAN_URL using key $ETHERSCAN_KEY"
forge script script/PimlicoEntryPointSimulations.s.sol:PimlicoEntryPointSimulationsScript \
--rpc-url "$RPC_URL" \
--account pimlico-utility \
--broadcast \
-vvvv
# Verify contracts only if ETHERSCAN_KEY and ETHERSCAN_URL are provided
if [[ -n "$ETHERSCAN_KEY" && -n "$ETHERSCAN_URL" ]]; then
echo "Verifying with $ETHERSCAN_URL using key $ETHERSCAN_KEY"
forge verify-contract 0xe1b9bcD4DbfAE61585691bdB9A100fbaAF6C8dB0 src/v07/PimlicoEntryPointSimulations.sol:PimlicoEntryPointSimulations \
--verifier-url "$ETHERSCAN_URL" \
--etherscan-api-key "$ETHERSCAN_KEY"
forge verify-contract 0x29C6bBdd6F4433f8d188616ADd22F842740ee982 src/v07/EntryPointSimulations.sol:EntryPointSimulations \
--verifier-url "$ETHERSCAN_URL" \
--etherscan-api-key "$ETHERSCAN_KEY"
else
echo "Skipping contract verification as ETHERSCAN_KEY and/or ETHERSCAN_URL are not provided."
fi
done