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

solc does not accept forge emitted JSON with verify-contract --show-standard-json-input #9421

Open
2 tasks
hernandp opened this issue Nov 27, 2024 · 0 comments
Open
2 tasks
Labels
T-bug Type: bug T-needs-triage Type: this issue needs to be labelled

Comments

@hernandp
Copy link

hernandp commented Nov 27, 2024

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (4817280 2024-11-12T00:20:12.440102314Z)

What command(s) is the bug in?

forge verify-contract --show-standard-json-input 0x0000000000000000000000000000000000000000 input.sol > solc.input.json

Operating System

Windows

Describe the bug

I am feeding solc 0.8.25 with the output of forge verify-contract --show-standard-json-input. I expect the emitted JSON to be valid for compiler input in standard JSON mode but it does not. There is a workaround, so this must be a minor bug in the specified forge version. For example, :

forge verify-contract --show-standard-json-input 0x0000000000000000000000000000000000000000 input.sol > solc.input.json

 ./solc --standard-json solc.input.json
 
{
   "errors":[
      {
         "component":"general",
         "formattedMessage":"* Line 1, Column 196011\n  Duplicate key: '../lib/evm/PriceOracle.sol'\n* Line 1, Column 204189\n  Extra non-whitespace after JSON value.\n",
         "message":"* Line 1, Column 196011\n  Duplicate key: '../lib/evm/IPriceOracle.sol'\n* Line 1, Column 204189\n  Extra non-whitespace after JSON value.\n",
         "severity":"error",
         "type":"JSONError"
      }
   ]
}

After applying some cleanup with:

cat solc.input.json | jq > solc.input.clean.json

solc 0.8.25 accepts this JSON as input without problem.

@hernandp hernandp added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Nov 27, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug T-needs-triage Type: this issue needs to be labelled
Projects
Status: Todo
Development

No branches or pull requests

1 participant