Skip to content

Commit

Permalink
Update entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
kant777 authored Jan 15, 2024
1 parent a06f290 commit c482302
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,24 @@ 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/}

# 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

if [ "$DEPLOY_TYPE" = "core" ]; then
echo "Deploying core contracts"
$FORGE_BIN_PATH script scripts/DeployScripts.s.sol:DeployScript --rpc-url "$RPC_URL" --private-key "$PRIVATE_KEY" --broadcast --chain-id "$CHAIN_ID" -vvvv --use 0.8.23
$FORGE_BIN_PATH script ${SCRIPT_PATH_PREFIX}DeployScripts.s.sol:DeployScript --rpc-url "$RPC_URL" --private-key "$PRIVATE_KEY" --broadcast --chain-id "$CHAIN_ID" -vvvv --use 0.8.23 $ROOT_OPTION

elif [ "$DEPLOY_TYPE" = "whitelist" ]; then
if [ -z "$HYP_ERC20_ADDR" ]; then
echo "HYP_ERC20_ADDR not specified"
exit 1
fi
echo "Deploying whitelist contract"
HYP_ERC20_ADDR="$HYP_ERC20_ADDR" $FORGE_BIN_PATH script scripts/DeployScripts.s.sol:DeployWhitelist --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --chain-id $CHAIN_ID -vvvv --use 0.8.23
HYP_ERC20_ADDR="$HYP_ERC20_ADDR" $FORGE_BIN_PATH script ${SCRIPT_PATH_PREFIX}DeployScripts.s.sol:DeployWhitelist --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --chain-id $CHAIN_ID -vvvv --use 0.8.23 $ROOT_OPTION
fi

0 comments on commit c482302

Please sign in to comment.