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

feat(forge): scripts should output formatted json to broadcast/ #2204

Closed
OliverNChalk opened this issue Jul 4, 2022 · 1 comment · Fixed by #2217
Closed

feat(forge): scripts should output formatted json to broadcast/ #2204

OliverNChalk opened this issue Jul 4, 2022 · 1 comment · Fixed by #2217
Labels
C-forge Command: forge Cmd-forge-script Command: forge script D-easy Difficulty: easy good first issue Good for newcomers P-low Priority: low T-feature Type: feature

Comments

@OliverNChalk
Copy link
Contributor

Component

Forge

Describe the feature you would like

It would make sense if forge script produced json files that are formatted in-line with how out/**/*.json is formatted. Currently, the written json is compact & single-line.

Current broadcast/:

{"transactions":[{"hash":"0x81ca81143efbd8e0300a14558ba3d3bf7c449ca40714bde1398f35bda863894c","type":"CALL","tx":{"type":"0x02","from":"0x70997970c51812dc3a010c7d01b50e0d17dc79c8","to":"0xa0ee7a142d267c1f36714e4a8f75612f20a79720","gas":"0x6aa4","value":"0xde0b6b3a7640000","data":"0x","nonce":"0x0","accessList":[]}}],"receipts":[{"transactionHash":"0x81ca81143efbd8e0300a14558ba3d3bf7c449ca40714bde1398f35bda863894c","transactionIndex":"0x0","blockHash":"0x831d6dfc4f6464bf18f81fa82580400f3d2f77ab1f51f138874d43e6e6d78487","blockNumber":"0x1","from":"0x70997970c51812dc3a010c7d01b50e0d17dc79c8","to":"0xa0ee7a142d267c1f36714e4a8f75612f20a79720","cumulativeGasUsed":"0x5208","gasUsed":"0x5208","contractAddress":null,"logs":[],"status":"0x1","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","effectiveGasPrice":"0xe6fa7a58"}],"libraries":[],"pending":[],"path":"broadcast/fund_owner.sol/31337/run-latest.json","returns":{},"timestamp":1656959845}

Current out/:

{
  "abi": [],
  "bytecode": {
    "object": "0x602d6037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c634300080f000a",
    "sourceMap": "194:8061:5:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;194:8061:5;;;;;;;;;;;;;;;;;",
    "linkReferences": {}
  },
  "deployedBytecode": {
    "object": "0x73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c634300080f000a",
    "sourceMap": "194:8061:5:-:0;;;;;;;;",
    "linkReferences": {}
  },
  "methodIdentifiers": {},
  "ast": {},
  "id": 5
}

Additional context

No response

@OliverNChalk OliverNChalk added the T-feature Type: feature label Jul 4, 2022
@gakonst
Copy link
Member

gakonst commented Jul 4, 2022

Oh we should just serialize as pretty json

@onbjerg onbjerg added good first issue Good for newcomers C-forge Command: forge P-low Priority: low D-easy Difficulty: easy Cmd-forge-script Command: forge script labels Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-script Command: forge script D-easy Difficulty: easy good first issue Good for newcomers P-low Priority: low T-feature Type: feature
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants