Testnet Smart contract err fixed: Gas estimation errored
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}
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".
I just want to share this because I know it will help someone.
I am tykee.
Posted with STEMGeeks
Congratulations @tykee! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)
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:
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.
Post reviewed and approved for an Ecency boost. 😊
Thanks.
Yay! 🤗
Your content has been boosted with Ecency Points, by @tykee.
Use Ecency daily to boost your growth on platform!
Support Ecency
Vote for new Proposal
Delegate HP and earn more