Testnet Smart contract err fixed: Gas estimation errored

avatar

Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Returned error: {"jsonrpc":"2.0","error":"invalid opcode: PUSH0","id":74798583002803402}

9953C099-DAFF-4230-85E2-3AD5DF30DA56.jpeg

I was working on a smart contract and I started with the main net because I am sure that what I am working on will work. I deployed to the mainnet and everything worked fine. However, I had issues with calculating Wei currently and there was a mistake in the figure set in the contract thus; I had to deploy again and I encounter another similar issue with another figure, then I decided to use testnet to avoid deploying the contract and wasting coins on it.

I decided to use testnet to test and deploy to main net when everything works fine. Then I changed the RPC and explorer to testnet and deployed, but I encountered an error. I was confused because everything seems to work well on main net so I decided to search the web. I did and all the solutions provided are not related to the error I had. So I decided to ask on the BNB discord and I got the information that

"The solution is to manually set the EVM version to some previous version, for example, "Paris" (the version before, also known as The Merge), instead of "Shanghai", which is the default now. "

The steps to fix this error in case you face a similar error building on Remix IDE is

  • Go to the Solidity Compiler tab
  • Toggle the "Advanced Configurations"
  • Toggle the "EVM VERSION" dropdown menu and select "Paris".

6BCCEEA0-E553-406B-851B-0321B9FB55C3.jpeg

I just want to share this because I know it will help someone.

I am tykee.

Posted with STEMGeeks



0
0
0.000
5 comments
avatar

Congratulations @tykee! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You received more than 45000 upvotes.
Your next target is to reach 50000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

Women's World Cup Contest - Recap of day 15
Our Hive Power Delegations to the July PUM Winners
Women's World Cup Contest - Recap of day 14
0
0
0.000
avatar

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support. 
 

0
0
0.000