Skip to content

Commit 0e2fe59

Browse files
Filipp MakarovFilipp Makarov
authored andcommitted
chore: deployment improvements
1 parent 093a1f7 commit 0e2fe59

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

script/deploy/config.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ verify = true
206206

207207
[97.uint]
208208
chain_id = 97
209+
# gas prices in gwei
210+
base_gas_price = 1
211+
priority_gas_price = 1
212+
# gas units multiplier in %
213+
gas_estimate_multiply = 110
209214

210215
[97.string]
211216
name = "BNB Testnet"

script/deploy/deploy-chain.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ else
102102
GAS_SUFFIX_SEND="$GAS_SUFFIX"
103103
fi
104104

105+
# Build gas estimate multiply suffix
106+
#parse config.toml to find the gas_estimate_multiply for the given chain ID
107+
GAS_ESTIMATE_MULTIPLY=$(awk -v id="$CHAIN_ID" '/^\['"$CHAIN_ID"'\.uint\]/{flag=1;next} /^\[/{flag=0} flag && /^gas_estimate_multiply =/{gsub(/"/, "", $3); print $3}' config.toml)
108+
if [ -z "$GAS_ESTIMATE_MULTIPLY" ]; then
109+
GAS_ESTIMATE_MULTIPLY_SUFFIX=""
110+
else
111+
GAS_ESTIMATE_MULTIPLY_SUFFIX="--gas-estimate-multiplier ${GAS_ESTIMATE_MULTIPLY}"
112+
fi
113+
105114
#### ================= START DEPLOYMENT LOGIC =================
106115

107116
# STEP 1: Verify / Deploy prerequisites
@@ -279,6 +288,11 @@ if [ "$CONTRACT_NAMES" = "[]" ]; then
279288
exit 0
280289
fi
281290

291+
# Log the parameters to the main log file
292+
printf "VERIFY_FLAG: $VERIFY_FLAG\n"
293+
printf "GAS_SUFFIX: $GAS_SUFFIX\n"
294+
printf "GAS_ESTIMATE_MULTIPLY_SUFFIX: $GAS_ESTIMATE_MULTIPLY_SUFFIX\n"
295+
282296
# Try to deploy and verify the contracts
283297
# If the script has been run successfully, exit with code 0
284298
# If the script has failed, there are two options:

0 commit comments

Comments
 (0)