question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: insufficient funds (version=4.0.47)

See original GitHub issue

Hi All, I am using this library to send usdt with the following code, but when I pass in 50 as amount to be sent to another address and my usdt balance is 97.59, then I got error: insufficient funds, but I have 97.59 usdt in my account, only sending 50, also my ETH balance in my account is 0.00125, which is for the gas fee:

wallet sendTUSDToAddress…error: Error: insufficient funds (version=4.0.47) 2020-05-28T16:38:10.716047+00:00 app[web.1]: at Object.throwError (/app/node_modules/ethers/errors.js:76:17) 2020-05-28T16:38:10.716047+00:00 app[web.1]: at /app/node_modules/ethers/providers/json-rpc-provider.js:276:36 2020-05-28T16:38:10.716048+00:00 app[web.1]: at processTicksAndRejections (internal/process/task_queues.js:97:5) { 2020-05-28T16:38:10.716049+00:00 app[web.1]: reason: ‘insufficient funds’, 2020-05-28T16:38:10.716050+00:00 app[web.1]: code: ‘INSUFFICIENT_FUNDS’, 2020-05-28T16:38:10.716050+00:00 app[web.1]: transaction: { 2020-05-28T16:38:10.716051+00:00 app[web.1]: nonce: 0, 2020-05-28T16:38:10.716052+00:00 app[web.1]: gasPrice: BigNumber { _hex: ‘0x0826299e00’ }, 2020-05-28T16:38:10.716054+00:00 app[web.1]: gasLimit: BigNumber { _hex: ‘0xa0ed’ }, 2020-05-28T16:38:10.716054+00:00 app[web.1]: to: ‘0xdAC17F958D2ee523a2206206994597C13D831ec7’, 2020-05-28T16:38:10.716054+00:00 app[web.1]: value: BigNumber { _hex: ‘0x00’ }, 2020-05-28T16:38:10.716056+00:00 app[web.1]: data: ‘0xa9059cbb000000000000000000000000df59a6d6c2f09210a60033e513ffd8d61c69be1f0000000000000000000000000000000000000000000000000000000002faf080’,

My code is:

`try{ let usdAbi = Token.abi; let contract = new ethers.Contract(contractAddressUSD, usdAbi,PROVIDER); let wallet2 = new ethers.Wallet(privateKeyDec, PROVIDER); let contractWithSigner = contract.connect(wallet2);

    var amount2 = utils.parseUnits(amount.toString(), 6).toNumber();
    let usdtBal = await contract.balanceOf(fromAddress);  
       console.log("wallet sendTUSDToAddress...amount2: ", amount2); 
    usdtBal = usdtBal.toString();
    console.log("wallet sendTUSDToAddress...usdtBal: ", usdtBal);
    if(Number(usdtBal) >= amount2){
      
        var transfer = await contractWithSigner.transfer(toAddress, amount2);  
        console.log("wallet sendTUSDToAddress...transfer: ", transfer);
        return transfer;
    }else{ 
      return {
        error: "Not enough Tether USD in your wallet",
        usdtbal: usdtBal
      }
    }
}catch(error) {
  
  console.log("wallet sendTUSDToAddress...error: ", error);
  return {
    error: error,
  }
}`

Any clues? Thanks for your help.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Ranalcommented, Nov 16, 2021

@zemse Thank you, turned out to be a problem with the wallet.

0reactions
HolySuicidalTurkeycommented, Dec 4, 2021

also don’t forget to suspend gas limits!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix "insufficient funds" error or greyed-out confirm button
How can I fix it? You can remedy this by sending some of the necessary native token to that account in order to...
Read more >
Insufficient funds no matter what (error -32000) #1659 - GitHub
Specific to @nazariyv, I finally did the math and this is just a case of insufficient funds. The mentioned address has 0.011 ETH...
Read more >
Insufficient funds for gas*price+value error - Stack Overflow
In my private Ethereum Blockchain network, I resolved the issue by changing the chainId variable in my genesis block code to any random...
Read more >
Towards better error statistics for atmospheric inversions of ...
the error statistics that is optimal in regard to objective sta- ... Database for Global Atmospheric Research (EDGAR v4.2;.
Read more >
New Jersey shore protection master plan - GovInfo
The most apparent problems are lack of maintenance on the seawall and the absence of adequate beach. The seawall protects the community and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found