Cannot deploy smart contract using remix and Injected Provider - MetaMask

I’m trying to deploy my smart contracts using remix and MetaMask and constantly get the error
“Gas estimation failed”
{“jsonrpc”:“2.0”,“error”:“Invalid params: unknown field type, expected one of from, to, gasPrice, gas, value, data, nonce.”,“id”:3748195990031828}

I’ve tried to clear the cache, and hard reload the browser (I’m using the latest version of Chrome on MacOS), but I still have the same result.
I managed to deploy the same contracts a few months ago and everything was fine.
Does MetaMask still work with remix?
What issue may have happened?


I think someone has hacked my account because i do t know anythingabout deploy smart contact using remix but its in my history

1 Like

Hi @hunter727 are you sure you have enough gas money, what network are you testing on. Usually this error is due to the lack of funds on the account. You need some to pay for gas

1 Like

@Bonniefied check your wallet activity on explorer and see if you spot anything suspicious if you don’t recognise the transaction address with

1 Like

I have much more funds than needed for deploying this contract, so that couldn’t be the reason. But thanks!

1 Like

It seems that API has changed because the error says that API accepted an unexpected field type. Does anybody know something about that?

@hunter727 thanks for confirming, unfortunately we would need more information about your setup to be able to look into it, for example what network are you deploying, the example of your contract, repro steps etc. Have you tried reaching Remix community. I found this open issue: Why I'm Getting the Gas estimation failed error · Issue #4071 · ethereum/remix-project · GitHub have a look

1 Like

Unfortunately, the open issue on remix is not related to my one, thanks.
Just for test reason, I’ve tried to deploy this simple contract and have the same issue:

// SPDX-License-Identifier: MIT
// compiler version must be greater than or equal to 0.8.20 and less than 0.9.0
pragma solidity ^0.8.20;

contract HelloWorld {
    string public greet = "Hello World!";


{"jsonrpc":"2.0","error":"Invalid params: unknown field `type`, expected one of `from`, `to`, `gasPrice`, `gas`, `value`, `data`, `nonce`.","id":3748195990031828}

This sounds like the issue does not depend on smart contract code, but related either to MetaMask API or Remix.

Have you tried reaching out to remix community, I’ve tested it too and had the same error you had I tested again yesterday my error changed I think there is something with remix
If you are having issues with remix maybe try deploying with hardhat or foundry

1 Like

no, I haven’t. Will try!
Additional details:

  • it is possible to “send transaction anyway” while deploying smart contracts from remix
  • I’ve found, that in that case deploying is finally successful (even if the gas estimation error appears) if the compiler version is less than 0.8.20. it is probably because the blockchain network doesn’t support shanghai evm
  • but I have no luck in verifying those smart contracts
  • Blockchain network we use is Bloxberg (sorry, I’m not able to place URL here)

going back to the issue with JSON RPC error - I’ve tried to deploy smart contracts to Goerli test network and managed to do that without any errors. It makes me think that the issue related to Bloxberg network but not to remix/MetaMask.
What network have you used trying to reproduce the issue?

1 Like

Thanks for sharing that’s interesting, I used goerli and ethereum mainnet, I’m not familiar with Bloxberg network. Maybe you could check with the Bloxberg community


3 posts were split to a new topic: Problem with transaction, arabic

Remix is easy you need to just understand dont copy paste code from anywhere,

1 Like