From 11ab3fd8907366c741c03ec00215e9013f58d3c6 Mon Sep 17 00:00:00 2001 From: Daniel <77058885+0xDEnYO@users.noreply.github.com> Date: Wed, 29 Jan 2025 15:04:21 +0700 Subject: [PATCH] add config flag to disable precompilation (#962) --- script/config.example.sh | 6 ++++++ script/scriptMaster.sh | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/script/config.example.sh b/script/config.example.sh index 52624d429..48f9c5054 100644 --- a/script/config.example.sh +++ b/script/config.example.sh @@ -97,3 +97,9 @@ MNEMONIC="test test test test test test test test test test test junk" PRIVATE_KEY_ANVIL=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 # address: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 START_LOCAL_ANVIL_NETWORK_ON_SCRIPT_STARTUP=false END_LOCAL_ANVIL_NETWORK_ON_SCRIPT_COMPLETION=true # set to false if you want to run several scripts on the same data/contracts without redeploying + +# all the periphery contracts listed here will automatically be whitelisted as DEX when deploying "all contracts" +WHITELIST_PERIPHERY="FeeCollector,LiFuelFeeCollector,TokenWrapper,LiFiDEXAggregator" + +# if this flag is set to false, the scriptMaster will not compile on start (helpful for zksync/abstract to avoid constant recompilations) +COMPILE_ON_STARTUP=false diff --git a/script/scriptMaster.sh b/script/scriptMaster.sh index 5e7e32773..2fa689d90 100755 --- a/script/scriptMaster.sh +++ b/script/scriptMaster.sh @@ -43,7 +43,9 @@ scriptMaster() { for script in script/tasks/*.sh; do [ -f "$script" ] && source "$script"; done # sources all script in folder script/tasks/ # make sure that all compiled artifacts are current - forge build + if [[ "$COMPILE_ON_STARTUP" == "true" ]]; then + forge build + fi # start local anvil network if flag in config is set if [[ "$START_LOCAL_ANVIL_NETWORK_ON_SCRIPT_STARTUP" == "true" ]]; then @@ -137,7 +139,7 @@ scriptMaster() { # Check if the foundry-zksync binaries exist, if not fetch them install_foundry_zksync 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") CONTRACT=$(echo $SCRIPT | sed -e 's/Deploy//')