1

If I can compile a smart-contract written in an older version say 0.1.3, can I still deploy it?

If I can, is there a way to look at EVM bytecode and tell that this smart contract is written with an older version of solidity?

  • 1
  • Some version of the compiler started to use new opcodes. So the presense/absense of those opcodes can indicate a possible range of versions used. But that is not 100% reliable since you can enable/disable the opcodes used with a command line flag. Also since the compiler is open source, you can compile your own version, or use a nightly release. – Ismael Aug 22 at 16:17
0

Basically, yes to your first question. The Solidity compiler generates native EVM code and wraps it in a function that causes the EVM to create a contract and give it that code. It's worked this way since the beginning, so any contract creation transaction data from previous versions of Solidity should still work.

There aren't that many reasons that you'd want to do this though - do ask yourself why you are doing this? One example would be to publish a contract that is compatible with an existing, already-deployed contract - as some of the ways that inter-contract calls are made have changed slightly over the years.

As to your second question - the simple answer is no, however it is partially addressed here: Is there a way to detect which compiler version produced a contract binary?

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.