Deprecate bytecode
for deployedBytecode
in setCode
action.
#2049
Unanswered
roninjin10
asked this question in
Idea / Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I believe viem should deprecate
bytecode
and instead usedeployedBytecode
Why
When solidity contracts are compiled they compile into bytecode and deployedBytecode. Bytecode is the code that runs when you deploy the contract to the chain. DeployedBytecode is the final result of the bytecode that actually ends up at the contract address after executing the deployment.
Because viem calls it
bytecode
it can be confusing which one you should use. For example, if you are looking at foundry artifacts you might incorrectly copy the json valuebytecode
when you should be copyingdeployedBytecode
Selfishly this makes it work way better with tevm too
Solution
bytecode
but keep it around for a bit so it's not a breaking change. Add newdeployedBytecode
propertybytecode
in a future major releaseBeta Was this translation helpful? Give feedback.
All reactions