Skip to content

Commit

Permalink
fix: keystore contract deployment (#100)
Browse files Browse the repository at this point in the history
* fix: keystore contract deployment

* refactor: use existing PWD env var
  • Loading branch information
shaspitz authored May 25, 2024
1 parent 09c7b45 commit 92c7213
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions contracts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ SCRIPT_PATH_PREFIX=${SCRIPT_PATH_PREFIX:-scripts/}

KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD:-"pwd"}

# Check if CONTRACT_REPO_ROOT_PATH is set, if so, prepare the --root option
ROOT_OPTION=""
if [ -n "$CONTRACT_REPO_ROOT_PATH" ]; then
ROOT_OPTION="--root $CONTRACT_REPO_ROOT_PATH"
fi
CONTRACT_REPO_ROOT_PATH=${CONTRACT_REPO_ROOT_PATH:-$PWD}

if [ "$DEPLOY_TYPE" = "core" ]; then
echo "Deploying core contracts"
Expand All @@ -24,14 +20,14 @@ if [ "$DEPLOY_TYPE" = "core" ]; then
--priority-gas-price 2000000000 \
--with-gas-price 5000000000 \
--rpc-url "$RPC_URL" \
--keystores ./deployer_keystore/* \
--keystores "$CONTRACT_REPO_ROOT_PATH"/deployer_keystore/* \
--password "$KEYSTORE_PASSWORD" \
--sender "a51f13769d1466e0b5483cb719e89add8d615052" \
--broadcast \
--chain-id "$CHAIN_ID" \
-vvvv \
--use 0.8.23 \
"$ROOT_OPTION" \
--root "$CONTRACT_REPO_ROOT_PATH" \
--via-ir

elif [ "$DEPLOY_TYPE" = "whitelist" ]; then
Expand All @@ -43,14 +39,15 @@ elif [ "$DEPLOY_TYPE" = "whitelist" ]; then
HYP_ERC20_ADDR="$HYP_ERC20_ADDR" $FORGE_BIN_PATH script \
"${SCRIPT_PATH_PREFIX}"DeployScripts.s.sol:DeployWhitelist \
--rpc-url "$RPC_URL" \
--keystores ./deployer_keystore/* \
--keystores "$CONTRACT_REPO_ROOT_PATH"/deployer_keystore/* \
--password "$KEYSTORE_PASSWORD" \
--sender "a51f13769d1466e0b5483cb719e89add8d615052" \
--broadcast \
--chain-id "$CHAIN_ID" \
-vvvv \
--use 0.8.23 \
"$ROOT_OPTION"
--root "$CONTRACT_REPO_ROOT_PATH" \
--via-ir

elif [ "$DEPLOY_TYPE" = "settlement-gateway" ]; then
if [ -z "$RELAYER_ADDR" ]; then
Expand All @@ -61,14 +58,15 @@ elif [ "$DEPLOY_TYPE" = "settlement-gateway" ]; then
RELAYER_ADDR="$RELAYER_ADDR" $FORGE_BIN_PATH script \
"${SCRIPT_PATH_PREFIX}"DeployStandardBridge.s.sol:DeploySettlementGateway \
--rpc-url "$RPC_URL" \
--keystores ./deployer_keystore/* \
--keystores "$CONTRACT_REPO_ROOT_PATH"/deployer_keystore/* \
--password "$KEYSTORE_PASSWORD" \
--sender "a51f13769d1466e0b5483cb719e89add8d615052" \
--broadcast \
--chain-id "$CHAIN_ID" \
-vvvv \
--use 0.8.23 \
"$ROOT_OPTION"
--root "$CONTRACT_REPO_ROOT_PATH" \
--via-ir

elif [ "$DEPLOY_TYPE" = "l1-gateway" ]; then
if [ -z "$RELAYER_ADDR" ]; then
Expand All @@ -79,14 +77,15 @@ elif [ "$DEPLOY_TYPE" = "l1-gateway" ]; then
RELAYER_ADDR="$RELAYER_ADDR" $FORGE_BIN_PATH script \
"${SCRIPT_PATH_PREFIX}"DeployStandardBridge.s.sol:DeployL1Gateway \
--rpc-url "$RPC_URL" \
--keystores ./deployer_keystore/* \
--keystores "$CONTRACT_REPO_ROOT_PATH"/deployer_keystore/* \
--password "$KEYSTORE_PASSWORD" \
--sender "a51f13769d1466e0b5483cb719e89add8d615052" \
--broadcast \
--chain-id "$CHAIN_ID" \
-vvvv \
--use 0.8.23 \
"$ROOT_OPTION"
--root "$CONTRACT_REPO_ROOT_PATH" \
--via-ir

elif [ "$DEPLOY_TYPE" = "validator-registry" ]; then
echo "Deploying validator registry contract"
Expand All @@ -96,13 +95,13 @@ elif [ "$DEPLOY_TYPE" = "validator-registry" ]; then
--with-gas-price 5000000000 \
"${SCRIPT_PATH_PREFIX}"DeployScripts.s.sol:DeployValidatorRegistry \
--rpc-url "$RPC_URL" \
--keystores ./deployer_keystore/* \
--keystores "$CONTRACT_REPO_ROOT_PATH"/deployer_keystore/* \
--password "$KEYSTORE_PASSWORD" \
--sender "a51f13769d1466e0b5483cb719e89add8d615052" \
--broadcast \
--chain-id "$CHAIN_ID" \
-vvvv \
--use 0.8.23 \
"$ROOT_OPTION" \
--root "$CONTRACT_REPO_ROOT_PATH" \
--via-ir
fi

0 comments on commit 92c7213

Please sign in to comment.