Reputation: 41
I'm developing the front-end to an application that I'm trying to test. However, MetaMask keeps giving me this error? I tried changing the gas limit like previously suggested and nothing. Any ideas?
Error: MetaMask - RPC Error: Internal JSON-RPC error.
code: -32603 data: {code: -32000, message: "gas required exceeds allowance (30000000) or always failing transaction"} message: "Internal JSON-RPC error."
Upvotes: 1
Views: 34393
Reputation: 1
You might have added the custom network in the MetaMask wallet.
In the MetaMask wallet go to Settings > Advanced and clear the data.
Do this whenever you have redeployed the contract or restarted the blockchain node.
This will stop the error.
Upvotes: 0
Reputation: 1
Before performing any transaction the sending ETH address must be connected to your own site or UI. So it can get the address of sending account and goes towards the further transaction in the metamask.
Make sure Your sending account address must be connected to your UI.
Upvotes: 0
Reputation: 191
In my case, after trying so many options I have restarted Ganache and re-imported new account from Ganache to Metamask. I connected this new account with localhost application.
This resoles my issue.
Upvotes: 0
Reputation: 44
Previously it used to happen in older versions due to a gas specification issue which was fixed. rpcErrors.internal` expects a string as the first argument, with arbitrary data being the optional second argument. Passing in a non- string first argument results in the error being shadowed by an error from eth-json-rpc-errors.
Please check what you are passing to Metamask.
Upvotes: 0
Reputation: 156
Without seeing the code, it's hard to say for sure but you could try:
const contractInstance = new state.web3.eth.Contract(
MyContract.abi,
"0x.....", // contract address
{
from: state.accounts[0],
gasPrice: 1000,
gas: 100000
}
);
Make sure the gas prices are similar to those, you may have to adjust for your case.
Re-compile and redeploy --> for truffle, run truffle develop
first, then compile
then migrate --reset
for local deployment.
In Metamask, reset your test account. Metamask > Select Account > Settings > Advanced > Reset account. Only do this for testing accounts
Upvotes: 0