diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index e1d8fcd782..cfbe2914d5 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -414,8 +414,12 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMs } allowance := new(big.Int).Div(available, call.GasPrice) if hi > allowance.Uint64() { + transfer := call.Value + if transfer == nil { + transfer = new(big.Int) + } log.Warn("Gas estimation capped by limited funds", "original", hi, "balance", balance, - "sent", call.Value, "gasprice", call.GasPrice, "fundable", allowance) + "sent", transfer, "gasprice", call.GasPrice, "fundable", allowance) hi = allowance.Uint64() } } diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 195da54fcd..45240aa2cf 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -937,8 +937,12 @@ func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrOrHash } allowance := new(big.Int).Div(available, args.GasPrice.ToInt()) if hi > allowance.Uint64() { + transfer := args.Value + if transfer == nil { + transfer = new(hexutil.Big) + } log.Warn("Gas estimation capped by limited funds", "original", hi, "balance", balance, - "sent", args.Value, "gasprice", args.GasPrice, "fundable", allowance) + "sent", transfer.ToInt(), "gasprice", args.GasPrice.ToInt(), "fundable", allowance) hi = allowance.Uint64() } }