1

I am using Truffle to compile the contracts and by default it compiles the contracts with pragma solidity 0.5.7 to evm version petersburg. Is it possible to compile the same contract for evm version istanbul?

A second question is when we compile a contract with older evm version say byzantium and them deploy to mainnet which is running istanbul hardfork then is it true that the istanbul hardfork is running the bytecode compiled by byzantium evm verion? If not, then how exactly does it work?

Thanks

0

Is it possible to compile the same contract for evm version istanbul?

  • No. You cannot compile contracts written using v0.5.7 to evm version istanbul.
  • As doing so will generate an error Invalid EVM version requested.
  • Why the above error?
    • Since the EVM versions (Target Versions) as specified in solidity docs for v0.5.7 is till petersburg and istanbul was added in v0.5.12

To answer your second question, YES.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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