I’m getting the following error:
Error: Internal JSON-RPC error.
at getEthJsonRpcError (errors.js?b80e:118:1)
at Object.internal (errors.js?b80e:28:1)
at provider.sendAsync (baseControllers.esm.js?d94b:447:13)
at async provider.request (baseControllers.esm.js?d94b:469:1)
Product UseCase: I’m using gelato relay with web3auth and gnosis safe to create a flow to buy NFTs using credit cards.
Issue being faced: My flow requires calling the “approve” function on an ERC-20 token, namely USD Coin(PoS) on the polygon Mumbai testnet. More details about the token are as follows: USD Coin (PoS) (USDC) Token Tracker | PolygonScan
However, this contract involves a proxy implementation, which means that many functions like approve have been written in another underlying contract, and function calls are delegated to that contract.
Coming to the issue being faced: Whenever I’m calling any write functions, like approve
, on this token using my web3auth signer, I’m getting the mentioned Internal JSON-RPC error.
However, this error is not being faced if I login on web3auth using metamask. This error only arises when I login using a method that comprises of an EOA being created by Web3auth.
Also note that:
- All types of calls on simple non-proxy contracts are working perfectly.
- Read calls like
balanceOf
are also working fine, regardless of the login method.
My hunch is that web3auth EOAs are facing an error in gas limit estimation or function calling for proxy contracts.
I have a project submission tomorrow, and am thus running on a crunched timeline. Looking forward to a resolution asap @shahbaz @yashovardhan
- SDK Version: web3auth/modal": “4.2.3”
- Platform: Web - Chrome
- Browser Console Screenshots:
Please provide the Web3Auth initialization and login code snippet below:
I’m using Gelato’s gasless wallet SDK, which has an integration of web3auth web modal in it.
const gaslessWalletConfig = { apiKey: process.env.NEXT_PUBLIC_GASLESSWALLET_KEY};
const loginConfig = {
domains: ["http://localhost:3000/"],
chain : {
id: 80001,
rpcUrl: "https://wiser-alien-morning.matic-testnet.discover.quiknode.pro/c2f6cfc05517853e094ad7ea47188326625f20b5/",
},
openLogin: {
redirectUrl: `http://localhost:3000/`,
},
};
const gaslessOnboarding = new GaslessOnboarding(
loginConfig,
gaslessWalletConfig
);
await gaslessOnboarding.init();
const web3AP = await gaslessOnboarding.login();
setWeb3AuthProvider(web3AP);