Can I deploy smart contract written in an older version of solidity ? If yes how to recognize it in EVM?
Can I deploy smart contract written in an older version of solidity ? If yes how to recognize it in EVM?
Loading saved threads...
n0unc3 · External communityPost link
External question — Ethereum Stack Exchange
Author: n0unc3
Original post: https://ethereum.stackexchange.com/questions/74166
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
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?
Quote
Report
Zakalwe · External communityPost link
External answer — Ethereum Stack Exchange
Author: Zakalwe
Original post: https://ethereum.stackexchange.com/a/74168
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
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?
Quote
Report
Grace · External communityPost link
External answer — Ethereum Stack Exchange
Author: Grace
Original post: https://ethereum.stackexchange.com/a/172442
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
To answer your second question, instead of looking at the bytecode to check what version was used to compile the smart contracts vulnerabilities code, you can just check etherscan or the respective blockchain scan. You’ll see the sol compilation version there
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External answer — Ethereum Stack Exchange Author: Grace Source score (net votes, not local likes): 0 Original post: https://ethereum.stackexchange.com/a/172442 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. To answer your second question, instead of looking at the bytecode to check what version was used to compile the smart contracts vulnerabilities code, you can just check etherscan or the respective blockchain scan. You’ll see the sol compilation version there
Checking account access…