From d5fef7950cf94f5c278b3f668d2f410ed29250bd Mon Sep 17 00:00:00 2001 From: Maximilian Langenfeld <15726643+ezdac@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:00:29 +0200 Subject: [PATCH] Add comment for nil fee-currency code path --- common/celo_types.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/celo_types.go b/common/celo_types.go index 44c59e857d..533c2416a5 100644 --- a/common/celo_types.go +++ b/common/celo_types.go @@ -21,12 +21,16 @@ func MaxAllowedIntrinsicGasCost(i IntrinsicGasCosts, feeCurrency *Address) (uint if !ok { return 0, false } - // allow the contract to overshoot 2 times the deducted intrinsic gas - // during execution + // Allow the contract to overshoot 2 times the deducted intrinsic gas + // during execution. + // If the feeCurrency is nil, then the max allowed intrinsic gas cost + // is 0 (i.e. not allowed) for a fee-currency specific EVM call within the STF. return intrinsicGas * 3, true } func CurrencyIntrinsicGasCost(i IntrinsicGasCosts, feeCurrency *Address) (uint64, bool) { + // the additional intrinsic gas cost for a non fee-currency + // transaction is 0 if feeCurrency == nil { return 0, true }