Generally these errors are associated with your RPC Provider. However, I want to check if you are getting this issue while logging in via Metamask or any Social Login?
I’m getting this issue with all login methods (MetaMask, Social, and Email Login).
About the RPC, is there a way to fallback with Web3Auth? I’ve been switching RPCs to fix this kind of issue, but it keeps happening. I’ve already used https://mainnet.infura.io/v3/${infuraToken}, https://eth-mainnet.g.alchemy.com/v2/${infuraToken} and now https://rpc.ankr.com/eth.
Thank you @maharshi . This issue constantly happens and blocks the user from completing the transaction. Sometimes the estimateGas function works, but sometimes (most of the time) it does not.
From what you’ve shared, it seems like the issue might be related to the stability of the RPC endpoints rather than your implementation or the login method, especially since it’s occurring across all login methods (MetaMask, Social, and Email).
Here are a few preliminary checks you can perform:
Check Wallet Balance: Ensure that the account you’re using has sufficient ETH balance. Even though estimateGas is just a simulation, some RPC providers might perform checks that require a balance.
Contract Method and ABI: To verify if the contract method and ABI are set up correctly, you can first use the call method before estimating gas. This will simulate the transaction without sending it and can help identify issues with the method or ABI. Also, tools like Etherscan or Remix IDE can be handy to cross-check your ABI and method signatures.
Transaction Simulation: Ensure the transaction itself wouldn’t fail due to logic errors or state-related conditions in your contract.
Regarding your question about fallback options between different RPC providers, Web3Auth doesn’t currently offer an automated fallback mechanism within the SDK. However, you can manually switch RPC providers as you’re already doing, though I understand this isn’t ideal.
Everything works when I call the contract methods on Etherscan. The problem is that when using our app, without specifying the gas fees, I get an error saying I don’t have enough ETH for the gas. And when I try to call the estimateGas function, I get the Internal JSON-RPC error. But sometimes it does work (mainly on Arbitrum). So I don’t think there’s an issue with the contract/ABI, otherwise it would never work.
The call method doesn’t work for me. I get Returned error: execution reverted: 2.