Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update zksync deploy script naming #942

Merged
merged 12 commits into from
Jan 30, 2025
17 changes: 14 additions & 3 deletions script/deploy/deploySingleContract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,18 @@ deploySingleContract() {
# We need to use zksync specific scripts that are able to be compiled for
# the zkvm
if [[ $NETWORK == "zksync" ]]; then
# update the deploy script directory to point to zksync-specific scripts
DEPLOY_SCRIPT_DIRECTORY="script/deploy/zksync/"
fi

if [[ -z "$CONTRACT" ]]; then
# get user-selected deploy script and contract from list
SCRIPT=$(ls -1 "$DEPLOY_SCRIPT_DIRECTORY" | sed -e 's/\.s.sol$//' | grep 'Deploy' | gum filter --placeholder "Deploy Script")
if [[ $NETWORK == "zksync" ]]; then
# get user-selected deploy script and contract from list
SCRIPT=$(ls -1 "$DEPLOY_SCRIPT_DIRECTORY" | sed -e 's/\.zksync.s.sol$//' | grep 'Deploy' | gum filter --placeholder "Deploy Script")
else
# get user-selected deploy script and contract from list
SCRIPT=$(ls -1 "$DEPLOY_SCRIPT_DIRECTORY" | sed -e 's/\.s.sol$//' | grep 'Deploy' | gum filter --placeholder "Deploy Script")
fi
mirooon marked this conversation as resolved.
Show resolved Hide resolved
local CONTRACT=$(echo $SCRIPT | sed -e 's/Deploy//')
else
SCRIPT="Deploy"$CONTRACT
Expand All @@ -116,7 +122,12 @@ deploySingleContract() {
fi

# check if deploy script exists
local FULL_SCRIPT_PATH=""$DEPLOY_SCRIPT_DIRECTORY""$SCRIPT"".s.sol""
if [[ $NETWORK == "zksync" ]]; then
FULL_SCRIPT_PATH="${DEPLOY_SCRIPT_DIRECTORY}${SCRIPT}.zksync.s.sol"
else
FULL_SCRIPT_PATH="${DEPLOY_SCRIPT_DIRECTORY}${SCRIPT}.s.sol"
fi
mirooon marked this conversation as resolved.
Show resolved Hide resolved

if ! checkIfFileExists "$FULL_SCRIPT_PATH" >/dev/null; then
error "could not find deploy script for $CONTRACT in this path: $FULL_SCRIPT_PATH". Aborting deployment.
if [[ -z "$EXIT_ON_ERROR" ]]; then
Expand Down
12 changes: 8 additions & 4 deletions script/scriptMaster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,18 @@ scriptMaster() {
# We need to make sure that the zksync fork of foundry is available before
# we can deploy contracts to zksync.
if [[ $NETWORK == "zksync" ]]; then
# Use zksync specific scripts
# update the deploy script directory to point to zksync-specific scripts
DEPLOY_SCRIPT_DIRECTORY="script/deploy/zksync/"
# Check if the foundry-zksync binaries exist, if not fetch them
install_foundry_zksync
# get user-selected deploy script and contract from list
SCRIPT=$(ls -1 "$DEPLOY_SCRIPT_DIRECTORY" | sed -e 's/\.zksync.s.sol$//' | grep 'Deploy' | gum filter --placeholder "Deploy Script")
else
# get user-selected deploy script and contract from list
SCRIPT=$(ls -1 "$DEPLOY_SCRIPT_DIRECTORY" | sed -e 's/\.s.sol$//' | grep 'Deploy' | gum filter --placeholder "Deploy Script")
mirooon marked this conversation as resolved.
Show resolved Hide resolved
fi

# get user-selected deploy script and contract from list
SCRIPT=$(ls -1 "$DEPLOY_SCRIPT_DIRECTORY" | sed -e 's/\.s.sol$//' | grep 'Deploy' | gum filter --placeholder "Deploy Script")

# extract contract name
CONTRACT=$(echo $SCRIPT | sed -e 's/Deploy//')

# check if new contract should be added to diamond after deployment (only check for
Expand Down
Loading