From a516d9f6e8efd856a79fe885012a57d73584e65c Mon Sep 17 00:00:00 2001 From: Webster Swift Date: Tue, 28 Oct 2025 14:58:56 +0300 Subject: [PATCH] fix: correct total gas price calculation to exclude gas tip cap --- pkg/walletsdk/evm/estimate.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/walletsdk/evm/estimate.go b/pkg/walletsdk/evm/estimate.go index 1d54d1c..b4d48e9 100644 --- a/pkg/walletsdk/evm/estimate.go +++ b/pkg/walletsdk/evm/estimate.go @@ -44,7 +44,7 @@ func (s *EVM) EstimateTransfer(ctx context.Context, fromAddress, toAddress, asse gasAmount = decimal.NewFromUint64(estimatedGas) gasTipCap = estimate.SuggestGasTipCap - totalGasPrice = estimate.MaxFeePerGas + totalGasPrice = estimate.MaxFeePerGas.Add(gasTipCap) totalFeeAmount = totalGasPrice.Mul(gasAmount) } else { amount = amount.Mul(decimal.NewFromInt(1).Mul(decimal.NewFromInt(10).Pow(decimal.NewFromInt(decimals)))) @@ -65,7 +65,7 @@ func (s *EVM) EstimateTransfer(ctx context.Context, fromAddress, toAddress, asse gasAmount = decimal.NewFromUint64(estimatedGas) gasTipCap = estimate.SuggestGasTipCap - totalGasPrice = estimate.MaxFeePerGas + totalGasPrice = estimate.MaxFeePerGas.Add(gasTipCap) totalFeeAmount = totalGasPrice.Mul(gasAmount) } @@ -133,7 +133,7 @@ func (s *EVM) EstimateFee(ctx context.Context) (*EstimateFeeResult, error) { fee.SuggestGasTipCap = minGasTipCap } - fee.MaxFeePerGas = GetBaseFeeMultiplier(fee.SuggestGasPrice).Add(fee.SuggestGasTipCap) + fee.MaxFeePerGas = GetBaseFeeMultiplier(fee.SuggestGasPrice) return fee, nil }