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

Why is bytecode and deployedBytecode from Hardhat/Truffle different than in solc-js #638

Open
damianlluch opened this issue Jun 28, 2022 · 1 comment
Labels
question waiting for more input Issues waiting for more input by the reporter

Comments

@damianlluch
Copy link

Hi, I am using solc-js independently as I am trying to deploy some contracts in Hedera.
I have a question for you.
Truffle and Hardhat generate a bytecode in the json that the ABI has. But it has a different format than the one generated by solc-js and I don't understand why.

But I can think of using Truffle or Hardhat to generate the bytecodes and then deploy them with the Hedera SDK, how do you see it?

Format generated by solc-js:

60806040523480156200........

Format generated by Hardhat - Truffle

0x60806040526040516200107..

do you have any explanation? the bytecodes are different anyway.
In Truffle - Hardhat it generates two bytecode and deployedBytecode that start with the same characters as the one generated by solc-js but then they are different.

thanks

@cameel cameel added the question label Jul 4, 2022
@cameel cameel changed the title Questions about bytecode and deployedBytecode Why is bytecode and deployedBytecode from Hardhat/Truffle different than in solc-js Jul 4, 2022
@ekpyron
Copy link
Member

ekpyron commented Aug 12, 2022

In general, why would you expect different tools to format their output in exactly the same way? Is the 0x prefix what you're getting at there? I'd consider that a rather arbitrary convention.

As for why the bytecode differs, we'd need a lot more details about how truffle/hardhat are set up and solc-js is called to actually evaluate the situation and helping.

Also, for questions like this, it may be better to post them in the forum or in the solidity language user matrix channel rather than in the issue tracker here.

@ekpyron ekpyron added the waiting for more input Issues waiting for more input by the reporter label Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question waiting for more input Issues waiting for more input by the reporter
Projects
None yet
Development

No branches or pull requests

3 participants