Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

RPC Error: err: insufficient funds for gas * price + value #7021

@luu-alex

Description

@luu-alex

trying to send a transaction with no data may error using rpc providers when there is sufficient funds for gas and values.

For example on metamask RPC Error: err: insufficient funds for gas * price + value, with unexpectedly high gas prices .

This issue is happening due to the sendtransaction method using eth_call to check if the smart contract will revert, but with metamask, eth_call will return an error expecting more gas to be provided.

Transaction sent:

object { from: "0xEd965cEAca9DE3DDE4e98109f52c3E195e3F2C91", to: "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", value: "0x5af3107a4000", gasPrice: undefined, maxPriorityFeePerGas: "0x9502f900", maxFeePerGas: "0x951425ae" }

Metamask error

MetaMask - RPC Error: err: insufficient funds for gas * price + value: address 

0xEd965cEAca9DE3DDE4e98109f52c3E195e3F2C91 have 508654303021506364 want 1250662775000000000 (supplied gas 500000000) 

Metamask is returning a revert issue wanting 1.250662775 eth when the transaction only needs atleast 0.005 eth in balance
Bug reported in #6997

Expected behavior

Actual behavior

Steps to reproduce the behavior

  1. [First step]
  2. [Second step]
  3. [and so on...]

Logs

Environment

Metadata

Metadata

Assignees

Labels

4.x4.0 relatedBugAddressing a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions