-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Self modifying code? #129
Comments
programs can't modify themselves, but the point still remains that a translation back to bytecode representation must be maintained for EVM execution (which makes reasoning about EVM code more difficult). |
Understood, thank you. Perhaps that line and the following can be improved. Such can be the scope of this issue.
|
Also, yes, difficult to reason. FYI, here's is a (limited) Solidity decompiler I am writing. It runs on the blockchain. Thought you might get a laugh out of that. |
Another point of view to consider is that while a contract cannot modify itself, it can construct an arbitrary fragment of code, CREATE it as a new contract, and then DELEGATECALL the contract it created to effectively execute arbitrary code. So I'm honestly not sure it's correct to claim that evm doesn't support self modifying code. |
Fair enough, can execute arbitrary code. I suggested a slightly different wording here. Fun stuff to look at for sure! |
Issues.md states:
The machine state (including memory) is defined in "9.4.1. Machine State" and the execution environment (including program code) is "9.3. Execution Environment."
CODECOPY is defined in the OPCODES table and brings code from the latter to the former.
How are you seeing that a program can modify itself?
The text was updated successfully, but these errors were encountered: