@@ -27,24 +27,28 @@ function apply_gas_multiplier {
2727 declare -i _gas_estimate=" $1 "
2828 shift
2929
30- # Mantle has funky gas rules, exclude it from this logic
31- if (( chainid != 5000 )) && (( _gas_estimate > eip7825 _gas_limit )) ; then
32- echo ' Gas estimate without buffer /already/ exceeds the EIP-7825 limit' >&2
33- exit 1
30+ # Mantle has funky gas rules, exclude it from this logic. EraVm chains similarly price in ergs, not gas.
31+ if (( _gas_estimate > eip7825 _gas_limit )) ; then
32+ if (( chainid != 5000 )) && [[ $era_vm != [Tt]rue ]] ; then
33+ echo ' Gas estimate without buffer /already/ exceeds the EIP-7825 limit' >&2
34+ exit 1
35+ fi
3436 fi
3537
3638 declare -i _gas_limit=$(( _gas_estimate * gas_estimate_multiplier / 100 ))
3739
38- if (( chainid != 5000 )) && (( _gas_limit > eip7825 _gas_limit )) ; then
39- declare _gas_limit_keep_going
40- IFS=' ' read -p ' Gas limit with multiplier exceeds EIP-7825 limit. Cap gas limit and keep going? [y/N]: ' -e -r -i n _gas_limit_keep_going
41- declare -r _gas_limit_keep_going
42- if [[ " ${_gas_limit_keep_going:- n} " != [Yy] ]] ; then
43- echo >&2
44- echo ' Exiting as requested' >&2
45- exit 1
40+ if (( _gas_limit > eip7825 _gas_limit )) ; then
41+ if (( chainid != 5000 )) && [[ $era_vm != [Tt]rue ]] ; then
42+ declare _gas_limit_keep_going
43+ IFS=' ' read -p ' Gas limit with multiplier exceeds EIP-7825 limit. Cap gas limit and keep going? [y/N]: ' -e -r -i n _gas_limit_keep_going
44+ declare -r _gas_limit_keep_going
45+ if [[ " ${_gas_limit_keep_going:- n} " != [Yy] ]] ; then
46+ echo >&2
47+ echo ' Exiting as requested' >&2
48+ exit 1
49+ fi
50+ _gas_limit=$eip7825_gas_limit
4651 fi
47- _gas_limit=$eip7825_gas_limit
4852 fi
4953
5054 echo $_gas_limit
0 commit comments