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 when getBalance: failed to meet quorum (method="getBlockNumber"

See original GitHub issue

image

Everything works great until suddenly, starts to broken, I was thinking maybe I did not provider the api key for the providers, but after providing, still the same, what am I missing here?

I am just getting the balance here, nothing fancy.

const provider = ethers.getDefaultProvider(activeEthNetwork, {
      infura: {
        projectId: 'aaa',
        projectSecret: 'aaa',
      },
      etherscan: 'aaa',
      alchemy:
        'https://eth-kovan.alchemyapi.io/v2/aaa',
    });


export class ERC20Service {
  tokenSymbol: ITokenSymbol;
  provider: ethers.providers.BaseProvider;
  contract: ERC20SmartContracts;
  decimals: number;

  constructor(
    tokenSymbol: IERC20TokenSymbol,
    networkName: IEthNetwork,
    provider: ethers.providers.BaseProvider,
  ) {
    const tokenInfo = ERC20Tokens[tokenSymbol];
    const networkInfo = tokenInfo.networks[networkName];

    this.tokenSymbol = tokenSymbol;
    this.provider = provider;

    this.contract = ERC20SmartContracts__factory.connect(
      networkInfo.tokenContractAddress,
      this.provider,
    );

    this.decimals = networkInfo.decimals;
  }

  balanceOf = async (ownerAddress: string) => {
    const balance = await this.contract.balanceOf(ownerAddress);

    const balanceParsed = ethers.utils.formatUnits(balance);

    return balanceParsed;
  };
}

I am using "ethers": "^5.4.7", on React native 😃 Great lib, thanks 😃

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ricmoocommented, Oct 17, 2021

Yes, you can show them the mnemonic for backup purposes, but internally you can store the wallet.privateKey And use that on future instantiations, which is fast.

1reaction
ricmoocommented, Oct 17, 2021

Provider and Contract creation is basically free. If a Wallet is created from a mnemonic or JSON wallet, there can be heavy computation done on limited hardware; RN usually has a debugger hook, which affects the tick in the event loop, so that can cause things to become slow. If you are using a private key though, it’s fast since the only computation is an elliptic point exponent and keccak256 to derive the address.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[v5] Failed to meet quorum when importing from ... - GitHub
When trying to use any Provider method, it seems that importing from @ethersproject/providers doesn't work, wheres importing from ethers ...
Read more >
Getting a "failed to meet quorum" error - EatTheBlocks Courses
Hello, I ran “node run-arbitrage.js” after successfully deploying to mainnet and I am getting "(node:36607) ...
Read more >
UniswapV2SlidingOracle: failed to meet quorum - Defender
The error happens when the job is workable for instance in the Unis… ... UniswapV2SlidingOracle: failed to meet quorum · Support Defender.
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