-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·47 lines (33 loc) · 1.45 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
41
42
43
44
45
46
#!/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 0x74Cb5e4eE81b86e70f9045036a1C5477de69eE87 src/PimlicoEntryPointSimulations.sol:PimlicoEntryPointSimulations \
--verifier-url "$ETHERSCAN_URL" \
--etherscan-api-key "$ETHERSCAN_KEY"
forge verify-contract 0xf384fddcaf70336dca46404d809153a0029a0253 src/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
# Use CHAIN and KEY as needed
# Example: echo "https://$CHAIN.rpc.thirdweb.com/$KEY"
# Insert your deployment and verification commands here
done