0

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":1895306911805812}

2 Answers 2

1

If you compiled it with Solidity 0.8.20, recompile with 0.8.19 and it should work.

Shanghai fork introduced the new opcode PUSH0, which allows memory and gas optimizations, and Solidity implemented it in 0.8.20. Any contract deployed to an environment previous to Shanghai should use Solidity 0.8.19 or below.

1
  • If possible, I can send you the complete code for AiHQianLan for you to take a look, as I am unable to deploy it on both the testnet and the Arb chain.
    – AiHQL_coin
    Commented Jun 20, 2023 at 6:25
0

PUSH0 is a new opcode that has been added in Shanghai, if you're using a network that uses an EVM version prior to that, you're gonna get this error. In your compiler tab in remix, go to advanced configuration and set it to something lower than Shanghai (like Paris, which is the previous hardfork) and you should be all good

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.