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

Include runtime_bytecode in artifacts #947

Merged
merged 1 commit into from Nov 2, 2023

Conversation

cburgdorf
Copy link
Collaborator

@cburgdorf cburgdorf commented Oct 31, 2023

What was wrong?

Currently, the compiler would only outputs the bytecode that is used for contract deployment but not the runtime bytecode that is later saved to storage and can be read out from the blockchain.

Being able to obtain the runtime bytecode is useful for contract verification.

How was it fixed?

Basically just expose the deployedBytecode that solc already gives us.
Note:

  • I named the file mycontract.runtime.bin because I find the term runtime bytecode less ambigious than deployed bytecode
  • Producing runtime bytecode is another variant of the --emit options. Note that the default did NOT change from abi, bytecode because there are certain contracts where we currently can not produce runtime bytecode for. These seem to be contracts that use create/create2 in __init__.
  • Related to the former point, getting the runtime bytecode is on demand e.g. --emit abi,bytecode,runtime-bytecode

@cburgdorf cburgdorf force-pushed the christoph/feat/runtime_bytecode branch 4 times, most recently from 11330a3 to e745618 Compare November 1, 2023 08:58
Copy link
Collaborator

@sbillig sbillig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sbillig sbillig merged commit 83cfbb4 into ethereum:master Nov 2, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants