Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

JSON Representation of CompilerOutput Incorrect #1422

Closed
tynes opened this issue Jun 28, 2022 · 2 comments · Fixed by #1424
Closed

JSON Representation of CompilerOutput Incorrect #1422

tynes opened this issue Jun 28, 2022 · 2 comments · Fixed by #1424
Labels
bug Something isn't working

Comments

@tynes
Copy link
Contributor

tynes commented Jun 28, 2022

Version
forge 0.2.0 (9dcc095 2022-06-28T00:03:46.153858156Z)

Platform
Linux 5.10.114-1-MANJARO x86_64 GNU/Linux

Description
The CompilerOutput JSON that is included in the BuildInfo is causing Hardhat to crash because it is serializing the bytecode and deployedBytecode with a 0x prefix while solc does not prefix those hex strings with 0x prefixes. This difference causes the conversion from a string to buffer in hardhat to fail and subsequently crash.

If the build info files generated by foundry are present, it will crash hardhat due to this reason.

@tynes tynes added the bug Something isn't working label Jun 28, 2022
@mattsse
Copy link
Collaborator

mattsse commented Jun 28, 2022

...
this is so annoying lol

we explicitly added 0x prefixes for artifacts which use the same types as CompilerOutput, I'm not sure yet what would be the simplest solution here

@tynes
Copy link
Contributor Author

tynes commented Jun 28, 2022

The 0x prefix is so standard at this point, if solc updates then it'll break a ton of tooling so idk we might be stuck with things like this
Linking the hh issue here: NomicFoundation/hardhat#2883

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants