Skip to content
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

Generating deployed bytecode #15644

Open
kaber2 opened this issue Dec 14, 2024 · 1 comment
Open

Generating deployed bytecode #15644

kaber2 opened this issue Dec 14, 2024 · 1 comment

Comments

@kaber2
Copy link

kaber2 commented Dec 14, 2024

With geth supporting code overrides in many RPC calls, I would very much like to use them during development as it is much easier for me to test on a life network than dealing with any of the Solidity development frameworks. However, despite multiple attempts, so far I haven't been able to find a way to have solidity generate the deployed bytecode, i.e. the bytecode as it would look on-chain after copying, replacing immutables, running all constructors etc.

Did I overlook something or is this not possible with Solidity at the moment? Are there any other methods people use to generate bytecode for overloading in RPC calls?

@kuzdogan
Copy link
Member

@kaber2 are you aware of the deployedBytecode output of the compiler? That is the runtime bytecode of the contract ie. the code stored at the contract address.

However it's before running the constructor, replacing immutables etc. as you mention so I'm guessing you are aware of this.

By definition the compiler can't do that because it just compiles the code into bytecode and hands it over to EVM. You can either do the "transformations" yourself (see some of them here) or you can hand the creation bytecode (bytecode in compiler output) to EVM of your choice with the appended constructor arguments and check the output which will be the final runtime bytecode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants