-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.sh
executable file
·74 lines (68 loc) · 2.58 KB
/
entrypoint.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
# Default to core deploy type if not specified
DEPLOY_TYPE=${DEPLOY_TYPE:-core}
# Set the forge binary path, default to 'forge' if not provided
FORGE_BIN_PATH=${FORGE_BIN_PATH:-forge}
# Define the script path prefix, default to 'scripts/' if not provided
SCRIPT_PATH_PREFIX=${SCRIPT_PATH_PREFIX:-scripts}
KEYSTORE_DIR=${KEYSTORE_DIR:-"$PWD/deployer_keystore"}
KEYSTORE_FILENAME=${KEYSTORE_FILENAME:-*}
KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD:-"pwd"}
CONTRACT_REPO_ROOT_PATH=${CONTRACT_REPO_ROOT_PATH:-$PWD}
if [ -n "${ETHERSCAN_API_KEY}" ]; then
VERIFY_OPTION="--verify"
fi
if [ "${DEPLOY_TYPE}" = "core" ]; then
if [ -z "$ORACLE_KEYSTORE_ADDRESS" ]; then
echo "ORACLE_KEYSTORE_ADDRESS not specified"
exit 1
fi
echo "Deploying core contracts in testnet environment"
ORACLE_KEYSTORE_ADDRESS="$ORACLE_KEYSTORE_ADDRESS" \
"${FORGE_BIN_PATH}" script \
"${SCRIPT_PATH_PREFIX}/core/DeployCore.s.sol:DeployCore" \
--root "${CONTRACT_REPO_ROOT_PATH}" \
--priority-gas-price 2000000000 \
--with-gas-price 5000000000 \
--chain-id "${CHAIN_ID}" \
--rpc-url "${RPC_URL}" \
--keystores "${KEYSTORE_DIR}/${KEYSTORE_FILENAME}" \
--password "${KEYSTORE_PASSWORD}" \
--sender "${SENDER}" \
--use 0.8.26 \
--broadcast \
--json \
--via-ir
elif [ "${DEPLOY_TYPE}" = "settlement-gateway" ]; then
echo "Deploying gateway contract on settlement chain"
"${FORGE_BIN_PATH}" script \
"${SCRIPT_PATH_PREFIX}/standard-bridge/DeployStandardBridge.s.sol:DeploySettlementGateway" \
--root "${CONTRACT_REPO_ROOT_PATH}" \
--priority-gas-price 2000000000 \
--with-gas-price 5000000000 \
--chain-id "${CHAIN_ID}" \
--rpc-url "${RPC_URL}" \
--keystores "${KEYSTORE_DIR}/${KEYSTORE_FILENAME}" \
--password "${KEYSTORE_PASSWORD}" \
--sender "${SENDER}" \
--use 0.8.26 \
--broadcast \
--json \
--via-ir
elif [ "${DEPLOY_TYPE}" = "l1-gateway" ]; then
"${FORGE_BIN_PATH}" script \
"${SCRIPT_PATH_PREFIX}/standard-bridge/DeployStandardBridge.s.sol:DeployL1Gateway" \
--root "${CONTRACT_REPO_ROOT_PATH}" \
--priority-gas-price 2000000000 \
--with-gas-price 5000000000 \
--rpc-url "${RPC_URL}" \
--chain-id "${CHAIN_ID}" \
--keystores "${KEYSTORE_DIR}/${KEYSTORE_FILENAME}" \
--password "${KEYSTORE_PASSWORD}" \
--sender "${SENDER}" \
--use 0.8.26 \
--broadcast \
--json \
${VERIFY_OPTION} \
--via-ir
fi